We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 020a25f commit 741785aCopy full SHA for 741785a
paddlenlp/trainer/trainer.py
@@ -3197,7 +3197,9 @@ def evaluation_loop(
3197
3198
# Metrics!
3199
if self.compute_metrics is not None and all_preds is not None and all_labels is not None:
3200
- metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
+ # all_labels maybe is a tuple when prediction_steps output label_mask
3201
+ batch_labels = all_labels[0] if isinstance(all_labels, (list, tuple)) else all_labels
3202
+ metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=batch_labels))
3203
else:
3204
metrics = {}
3205
0 commit comments