Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Jul 10, 2024
1 parent 9a5626d commit 3aa89bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/dailymail/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def compute_train_loss(
).flatten()
masks = batch["labels"].view(-1) == -100
sampled_labels[masks] = -100
return F.cross_entropy(logits, sampled_labels, reduction="sum")
return F.cross_entropy(logits.view(-1, logits.size(-1)), sampled_labels, reduction="sum")

def compute_measurement(
self,
Expand Down

0 comments on commit 3aa89bc

Please sign in to comment.