Spaces:
Build error
Build error
Try list of feature types
Browse files- vendiscore.py +18 -5
vendiscore.py
CHANGED
@@ -74,11 +74,12 @@ def get_dtype(config_name):
|
|
74 |
return datasets.Features({"samples": datasets.Value("string")})
|
75 |
if config_name == "image":
|
76 |
return datasets.Features({"samples": datasets.Image})
|
77 |
-
|
78 |
return datasets.Array2D
|
79 |
-
|
80 |
-
return datasets.
|
81 |
-
|
|
|
82 |
|
83 |
|
84 |
@evaluate.utils.file_utils.add_start_docstrings(
|
@@ -95,7 +96,19 @@ class VendiScore(evaluate.Metric):
|
|
95 |
description=_DESCRIPTION,
|
96 |
citation=_CITATION,
|
97 |
inputs_description=_KWARGS_DESCRIPTION,
|
98 |
-
features=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
homepage="http://github.com/Vertaix/Vendi-Score",
|
100 |
codebase_urls=["http://github.com/Vertaix/Vendi-Score"],
|
101 |
reference_urls=[],
|
|
|
74 |
return datasets.Features({"samples": datasets.Value("string")})
|
75 |
if config_name == "image":
|
76 |
return datasets.Features({"samples": datasets.Image})
|
77 |
+
elif config_name in ("X", "K"):
|
78 |
return datasets.Array2D
|
79 |
+
elif config_name == "default":
|
80 |
+
return datasets.Value("string")
|
81 |
+
else:
|
82 |
+
return datasets.Value(config_name)
|
83 |
|
84 |
|
85 |
@evaluate.utils.file_utils.add_start_docstrings(
|
|
|
96 |
description=_DESCRIPTION,
|
97 |
citation=_CITATION,
|
98 |
inputs_description=_KWARGS_DESCRIPTION,
|
99 |
+
features=[
|
100 |
+
datasets.Features({"samples": datasets.Value("string")}),
|
101 |
+
datasets.Features({"samples": datasets.Value("int32")}),
|
102 |
+
datasets.Features(
|
103 |
+
{"samples": datasets.Sequence(datasets.Value("int32"))}
|
104 |
+
),
|
105 |
+
datasets.Features({"samples": datasets.Value("float")}),
|
106 |
+
datasets.Features(
|
107 |
+
{"samples": datasets.Sequence(datasets.Value("float"))}
|
108 |
+
),
|
109 |
+
datasets.Features({"samples": datasets.Image}),
|
110 |
+
datasets.Features({"samples": datasets.Array2D}),
|
111 |
+
],
|
112 |
homepage="http://github.com/Vertaix/Vendi-Score",
|
113 |
codebase_urls=["http://github.com/Vertaix/Vendi-Score"],
|
114 |
reference_urls=[],
|