Fix semantic error in evaluation section (#27675)

Change "convert predictions to logits" to "convert logits to
predictions" to fix semantic error in the evaluation section. Logits
need to be converted to predictions to evaluate the accuracy, not the
other way round
This commit is contained in:
Anirudh Haritas Murali
2023-11-24 17:11:16 +05:30
committed by GitHub
parent 181f85da24
commit 2098d343cc

View File

@@ -119,7 +119,7 @@ Specify where to save the checkpoints from your training:
>>> metric = evaluate.load("accuracy") >>> metric = evaluate.load("accuracy")
``` ```
Call [`~evaluate.compute`] on `metric` to calculate the accuracy of your predictions. Before passing your predictions to `compute`, you need to convert the predictions to logits (remember all 🤗 Transformers models return logits): Call [`~evaluate.compute`] on `metric` to calculate the accuracy of your predictions. Before passing your predictions to `compute`, you need to convert the logits to predictions (remember all 🤗 Transformers models return logits):
```py ```py
>>> def compute_metrics(eval_pred): >>> def compute_metrics(eval_pred):