Skip to content

Commit

Permalink
apply ignore_prompt on valid batches
Browse files Browse the repository at this point in the history
  • Loading branch information
l-k-11235 committed Mar 12, 2024
1 parent bedbcc4 commit ad5d653
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onmt/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def validate(self, valid_iter, moving_average=None):
)

# Compute loss.
if self.zero_out_prompt_loss:
batch = self.valid_loss.ignore_prompt(batch)
_, batch_stats = self.valid_loss(batch, model_out, attns)

stats.update(batch_stats)
Expand Down

0 comments on commit ad5d653

Please sign in to comment.