From ad5d6535d8785b63a27f7d96c959be4a85d773fb Mon Sep 17 00:00:00 2001 From: l-k-11235 Date: Tue, 12 Mar 2024 15:18:07 +0100 Subject: [PATCH] apply ignore_prompt on valid batches --- onmt/trainer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onmt/trainer.py b/onmt/trainer.py index d580b19fd1..53a1d60c14 100644 --- a/onmt/trainer.py +++ b/onmt/trainer.py @@ -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)