fix run seq2seq (#10547)

This commit is contained in:
Patrick von Platen
2021-03-05 18:17:12 +03:00
committed by GitHub
parent 54e55b52d4
commit 395ffcd757

View File

@@ -251,7 +251,7 @@ def main():
pred_logits = pred.predictions pred_logits = pred.predictions
pred_ids = np.argmax(pred_logits, axis=-1) pred_ids = np.argmax(pred_logits, axis=-1)
pred.label_ids[pred.label_ids == -100] = 0 pred.label_ids[pred.label_ids == -100] = processor.tokenizer.pad_token_id
pred_str = processor.batch_decode(pred_ids) pred_str = processor.batch_decode(pred_ids)
# we do not want to group tokens when computing the metrics # we do not want to group tokens when computing the metrics