lvwerra HF staff commited on
Commit
1f4e6b8
1 Parent(s): f61b480

Update Space (evaluate main: e4a27243)

Browse files
Files changed (2) hide show
  1. glue.py +18 -20
  2. requirements.txt +1 -1
glue.py CHANGED
@@ -104,30 +104,28 @@ def pearson_and_spearman(preds, labels):
104
 
105
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
106
  class Glue(evaluate.Metric):
107
- def _info(self):
108
- if self.config_name not in [
109
- "sst2",
110
- "mnli",
111
- "mnli_mismatched",
112
- "mnli_matched",
113
- "cola",
114
- "stsb",
115
- "mrpc",
116
- "qqp",
117
- "qnli",
118
- "rte",
119
- "wnli",
120
- "hans",
121
- ]:
122
- raise KeyError(
123
- "You should supply a configuration name selected in "
124
- '["sst2", "mnli", "mnli_mismatched", "mnli_matched", '
125
- '"cola", "stsb", "mrpc", "qqp", "qnli", "rte", "wnli", "hans"]'
126
- )
127
  return evaluate.MetricInfo(
128
  description=_DESCRIPTION,
129
  citation=_CITATION,
130
  inputs_description=_KWARGS_DESCRIPTION,
 
131
  features=datasets.Features(
132
  {
133
  "predictions": datasets.Value("int64" if self.config_name != "stsb" else "float32"),
 
104
 
105
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
106
  class Glue(evaluate.Metric):
107
+
108
+ ALLOWED_CONFIG_NAMES = [
109
+ "sst2",
110
+ "mnli",
111
+ "mnli_mismatched",
112
+ "mnli_matched",
113
+ "cola",
114
+ "stsb",
115
+ "mrpc",
116
+ "qqp",
117
+ "qnli",
118
+ "rte",
119
+ "wnli",
120
+ "hans",
121
+ ]
122
+
123
+ def _info(self, config):
 
 
 
124
  return evaluate.MetricInfo(
125
  description=_DESCRIPTION,
126
  citation=_CITATION,
127
  inputs_description=_KWARGS_DESCRIPTION,
128
+ config=config,
129
  features=datasets.Features(
130
  {
131
  "predictions": datasets.Value("int64" if self.config_name != "stsb" else "float32"),
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- git+https://github.com/huggingface/evaluate@80448674f5447a9682afe051db243c4a13bfe4ff
2
  scipy
3
  sklearn
 
1
+ git+https://github.com/huggingface/evaluate@e4a2724377909fe2aeb4357e3971e5a569673b39
2
  scipy
3
  sklearn