Fix a bug
Browse files- eval_utils.py +2 -2
eval_utils.py
CHANGED
|
@@ -25,8 +25,8 @@ def predict_top_p(model, tokenizer, text, P=0.9):
|
|
| 25 |
break
|
| 26 |
|
| 27 |
if (
|
| 28 |
-
str(model.config.to_dict()["id2label"][
|
| 29 |
-
or str(model.config.to_dict()["id2label"][
|
| 30 |
):
|
| 31 |
return [DIALECTS[i] for i, p in enumerate(predictions) if p == 1]
|
| 32 |
else:
|
|
|
|
| 25 |
break
|
| 26 |
|
| 27 |
if (
|
| 28 |
+
str(model.config.to_dict()["id2label"][0]) == "LABEL_0"
|
| 29 |
+
or str(model.config.to_dict()["id2label"][0]) == "Algeria"
|
| 30 |
):
|
| 31 |
return [DIALECTS[i] for i, p in enumerate(predictions) if p == 1]
|
| 32 |
else:
|