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

Update Space (evaluate main: c447fc8e)

Browse files
Files changed (2) hide show
  1. glue.py +20 -18
  2. requirements.txt +1 -1
glue.py CHANGED
@@ -104,28 +104,30 @@ def pearson_and_spearman(preds, labels):
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"),
 
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"),
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