Update the docstring for the top_p method
Browse files- eval_utils.py +1 -1
eval_utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from constants import DIALECTS, DIALECTS_WITH_LABELS
|
|
| 3 |
|
| 4 |
|
| 5 |
def predict_top_p(model, tokenizer, text, P=0.9):
|
| 6 |
-
"""Predict the top dialects with an accumulative confidence of at least P."""
|
| 7 |
assert P <= 1 and P >= 0
|
| 8 |
|
| 9 |
logits = model(**tokenizer(text, return_tensors="pt")).logits
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def predict_top_p(model, tokenizer, text, P=0.9):
|
| 6 |
+
"""Predict the top dialects with an accumulative confidence of at least P (set by default to 0.9)."""
|
| 7 |
assert P <= 1 and P >= 0
|
| 8 |
|
| 9 |
logits = model(**tokenizer(text, return_tensors="pt")).logits
|