Spaces:
Build error
Build error
Try dynamic value type
Browse files- vendiscore.py +11 -1
vendiscore.py
CHANGED
@@ -69,6 +69,16 @@ Examples:
|
|
69 |
"""
|
70 |
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
@evaluate.utils.file_utils.add_start_docstrings(
|
73 |
_DESCRIPTION, _KWARGS_DESCRIPTION
|
74 |
)
|
@@ -85,7 +95,7 @@ class VendiScore(evaluate.Metric):
|
|
85 |
inputs_description=_KWARGS_DESCRIPTION,
|
86 |
features=datasets.Features(
|
87 |
{
|
88 |
-
"samples":
|
89 |
}
|
90 |
),
|
91 |
homepage="http://github.com/Vertaix/Vendi-Score",
|
|
|
69 |
"""
|
70 |
|
71 |
|
72 |
+
def get_dtype(config_name):
|
73 |
+
if config_name == "text":
|
74 |
+
return datasets.Value("string")
|
75 |
+
if config_name == "image":
|
76 |
+
return datasets.Image
|
77 |
+
elif config_name in ("X", "K"):
|
78 |
+
return datasets.Array2D
|
79 |
+
return datasets.Value("string")
|
80 |
+
|
81 |
+
|
82 |
@evaluate.utils.file_utils.add_start_docstrings(
|
83 |
_DESCRIPTION, _KWARGS_DESCRIPTION
|
84 |
)
|
|
|
95 |
inputs_description=_KWARGS_DESCRIPTION,
|
96 |
features=datasets.Features(
|
97 |
{
|
98 |
+
"samples": get_dtype(self.config_name),
|
99 |
}
|
100 |
),
|
101 |
homepage="http://github.com/Vertaix/Vendi-Score",
|