Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
prevent division by zero (#3555)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Dinan authored Mar 26, 2021
1 parent bbd6e26 commit 91cd630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parlai/scripts/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def _compute_eta(
eta = time_left

max_train_steps = self.opt.get('max_train_steps', -1)
if max_train_steps > 0:
if max_train_steps > 0 and steps_taken > 0:
steps_progress = steps_taken / max_train_steps
eta = (1 - steps_progress) * time_elapsed / steps_progress

Expand Down

0 comments on commit 91cd630

Please sign in to comment.