lvwerra HF staff commited on
Commit
2e592e3
1 Parent(s): 43628ee

Update Space (evaluate main: c447fc8e)

Browse files
Files changed (2) hide show
  1. indic_glue.py +22 -19
  2. requirements.txt +1 -1
indic_glue.py CHANGED
@@ -104,29 +104,32 @@ def precision_at_10(en_sentvecs, in_sentvecs):
104
 
105
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
106
  class IndicGlue(evaluate.Metric):
107
-
108
- ALLOWED_CONFIG_NAMES = [
109
- "wnli",
110
- "copa",
111
- "sna",
112
- "csqa",
113
- "wstp",
114
- "inltkh",
115
- "bbca",
116
- "cvit-mkb-clsr",
117
- "iitp-mr",
118
- "iitp-pr",
119
- "actsa-sc",
120
- "md",
121
- "wiki-ner",
122
- ]
123
-
124
- def _info(self, config):
 
 
 
 
125
  return evaluate.MetricInfo(
126
  description=_DESCRIPTION,
127
  citation=_CITATION,
128
  inputs_description=_KWARGS_DESCRIPTION,
129
- config=config,
130
  features=datasets.Features(
131
  {
132
  "predictions": datasets.Value("int64")
 
104
 
105
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
106
  class IndicGlue(evaluate.Metric):
107
+ def _info(self):
108
+ if self.config_name not in [
109
+ "wnli",
110
+ "copa",
111
+ "sna",
112
+ "csqa",
113
+ "wstp",
114
+ "inltkh",
115
+ "bbca",
116
+ "cvit-mkb-clsr",
117
+ "iitp-mr",
118
+ "iitp-pr",
119
+ "actsa-sc",
120
+ "md",
121
+ "wiki-ner",
122
+ ]:
123
+ raise KeyError(
124
+ "You should supply a configuration name selected in "
125
+ '["wnli", "copa", "sna", "csqa", "wstp", "inltkh", "bbca", '
126
+ '"cvit-mkb-clsr", "iitp-mr", "iitp-pr", "actsa-sc", "md", '
127
+ '"wiki-ner"]'
128
+ )
129
  return evaluate.MetricInfo(
130
  description=_DESCRIPTION,
131
  citation=_CITATION,
132
  inputs_description=_KWARGS_DESCRIPTION,
 
133
  features=datasets.Features(
134
  {
135
  "predictions": datasets.Value("int64")
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- git+https://github.com/huggingface/evaluate@e4a2724377909fe2aeb4357e3971e5a569673b39
2
  scipy
3
  sklearn
 
1
+ git+https://github.com/huggingface/evaluate@c447fc8eda9c62af501bfdc6988919571050d950
2
  scipy
3
  sklearn