Spaces:
Sleeping
Sleeping
Resolve the error with model_type
Browse files
semf1.py
CHANGED
@@ -85,6 +85,7 @@ Examples:
|
|
85 |
[0.77, 0.56]
|
86 |
"""
|
87 |
|
|
|
88 |
|
89 |
class Encoder(metaclass=abc.ABCMeta):
|
90 |
@abc.abstractmethod
|
@@ -160,14 +161,14 @@ class SemF1(evaluate.Metric):
|
|
160 |
|
161 |
def _get_model_name(self, model_type: Optional[str] = None) -> str:
|
162 |
# TODO: make it work with USE as well
|
|
|
|
|
|
|
163 |
if model_type not in self._MODEL_TYPE_TO_NAME.keys():
|
164 |
raise ValueError(f"Provide a correct model_type.\n"
|
165 |
f"Options: {self._MODEL_TYPE_TO_NAME.keys()}\n"
|
166 |
f"Currently provided: {model_type}")
|
167 |
|
168 |
-
if model_type is None:
|
169 |
-
model_type = "pv1" # Change it to use
|
170 |
-
|
171 |
return self._MODEL_TYPE_TO_NAME[model_type]
|
172 |
|
173 |
def _compute(self, predictions, references, model_type: Optional[str] = None):
|
|
|
85 |
[0.77, 0.56]
|
86 |
"""
|
87 |
|
88 |
+
[["I go to School.", "You are stupid."]]
|
89 |
|
90 |
class Encoder(metaclass=abc.ABCMeta):
|
91 |
@abc.abstractmethod
|
|
|
161 |
|
162 |
def _get_model_name(self, model_type: Optional[str] = None) -> str:
|
163 |
# TODO: make it work with USE as well
|
164 |
+
if model_type is None:
|
165 |
+
model_type = "pv1" # Change it to use
|
166 |
+
|
167 |
if model_type not in self._MODEL_TYPE_TO_NAME.keys():
|
168 |
raise ValueError(f"Provide a correct model_type.\n"
|
169 |
f"Options: {self._MODEL_TYPE_TO_NAME.keys()}\n"
|
170 |
f"Currently provided: {model_type}")
|
171 |
|
|
|
|
|
|
|
172 |
return self._MODEL_TYPE_TO_NAME[model_type]
|
173 |
|
174 |
def _compute(self, predictions, references, model_type: Optional[str] = None):
|