Skip to content

Commit

Permalink
Fix metric computation in run_glue_no_trainer (huggingface#11569)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored and Iwontbecreative committed Jul 15, 2021
1 parent 40c40d0 commit 5c949e4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def preprocess_function(examples):
model.eval()
for step, batch in enumerate(eval_dataloader):
outputs = model(**batch)
predictions = outputs.logits.argmax(dim=-1)
predictions = outputs.logits.argmax(dim=-1) if not is_regression else outputs.logits.squeeze()
metric.add_batch(
predictions=accelerator.gather(predictions),
references=accelerator.gather(batch["labels"]),
Expand Down

0 comments on commit 5c949e4

Please sign in to comment.