Skip to content

Commit

Permalink
Revert "linting and comment"
Browse files Browse the repository at this point in the history
This reverts commit 5763591.
  • Loading branch information
Mickus Timothee committed Sep 25, 2023
1 parent 5763591 commit 30ba781
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions onmt/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,10 @@ def validate(self, valid_iter, moving_average=None, task=None):
# Set model back to training mode.
valid_model.train()

# the forward hook `has_grad` was triggered, so we manually unset the flags to not fool the optim
for p in self.model.parameters():
if hasattr(p, 'has_grad'):
p.has_grad = False

return stats

def _gradient_accumulation_over_lang_pairs(
Expand Down

0 comments on commit 30ba781

Please sign in to comment.