Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Mar 20, 2024
1 parent 0a6cf5b commit 607eb1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/glue/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def evaluate_model(model: nn.Module, dataset: data.Dataset, batch_size: int) ->
batch["attention_mask"].to(device=DEVICE),
).logits
labels = batch["labels"].to(device=DEVICE)
total_loss += F.cross_entropy(outputs, labels, reduction="sum").detach().item()
total_loss += F.cross_entropy(outputs, labels, reduction="sum").detach()
predictions = outputs.argmax(dim=-1)
metric.add_batch(
predictions=predictions,
Expand Down

0 comments on commit 607eb1a

Please sign in to comment.