From 607eb1a310faa6164949a40418bbc4bc70b660fd Mon Sep 17 00:00:00 2001 From: Juhan Bae Date: Wed, 20 Mar 2024 02:54:26 -0400 Subject: [PATCH] minor --- examples/glue/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/glue/train.py b/examples/glue/train.py index 0cb626c..a2b8c33 100644 --- a/examples/glue/train.py +++ b/examples/glue/train.py @@ -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,