Skip to content

Commit 8479526

Browse files
authored
apply ignore_prompt on valid batches (#2568)
1 parent c9c9ee3 commit 8479526

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

onmt/trainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ def validate(self, valid_iter, moving_average=None):
401401
)
402402

403403
# Compute loss.
404+
if self.zero_out_prompt_loss:
405+
batch = self.valid_loss.ignore_prompt(batch)
404406
_, batch_stats = self.valid_loss(batch, model_out, attns)
405407

406408
stats.update(batch_stats)

0 commit comments

Comments
 (0)