danf0 commited on
Commit
1d6cdd3
1 Parent(s): b430aee

Try dynamic value type

Browse files
Files changed (1) hide show
  1. vendiscore.py +4 -9
vendiscore.py CHANGED
@@ -74,12 +74,11 @@ 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
- elif config_name in ("X", "K"):
78
  return datasets.Array2D
79
- elif config_name == "default":
80
  return datasets.Features({"samples": datasets.Value("string")})
81
- else:
82
- return datasets.Features({"samples": datasets.Value(config_name)})
83
 
84
 
85
  @evaluate.utils.file_utils.add_start_docstrings(
@@ -96,11 +95,7 @@ class VendiScore(evaluate.Metric):
96
  description=_DESCRIPTION,
97
  citation=_CITATION,
98
  inputs_description=_KWARGS_DESCRIPTION,
99
- features=datasets.Features(
100
- {
101
- "samples": get_dtype(self.config_name),
102
- }
103
- ),
104
  homepage="http://github.com/Vertaix/Vendi-Score",
105
  codebase_urls=["http://github.com/Vertaix/Vendi-Score"],
106
  reference_urls=[],
 
74
  return datasets.Features({"samples": datasets.Value("string")})
75
  if config_name == "image":
76
  return datasets.Features({"samples": datasets.Image})
77
+ if config_name in ("X", "K"):
78
  return datasets.Array2D
79
+ if config_name == "default":
80
  return datasets.Features({"samples": datasets.Value("string")})
81
+ return datasets.Features({"samples": datasets.Value(config_name)})
 
82
 
83
 
84
  @evaluate.utils.file_utils.add_start_docstrings(
 
95
  description=_DESCRIPTION,
96
  citation=_CITATION,
97
  inputs_description=_KWARGS_DESCRIPTION,
98
+ features=get_dtype(self.config_name),
 
 
 
 
99
  homepage="http://github.com/Vertaix/Vendi-Score",
100
  codebase_urls=["http://github.com/Vertaix/Vendi-Score"],
101
  reference_urls=[],