Skip to content

Commit

Permalink
no_grad
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanLee97 committed Sep 30, 2024
1 parent 58a0146 commit d03a118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion angle_emb/angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ def compute_loss(self, model, inputs, return_outputs: bool = False):

return (loss, outputs) if return_outputs else loss

@torch.no_grad()
def prediction_step(self, model, inputs, *args, **kwargs):
eval_loss = self.compute_loss(model, inputs, return_outputs=False)
return eval_loss, None, None
Expand Down Expand Up @@ -1542,7 +1543,6 @@ def fit(self,
logging_steps=logging_steps,
save_strategy=save_strategy,
evaluation_strategy=evaluation_strategy,
prediction_loss_only=True,
eval_steps=eval_steps,
save_steps=save_steps,
output_dir=output_dir,
Expand Down

0 comments on commit d03a118

Please sign in to comment.