Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix divide by zero when reducing dataloader length #1286

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helpers/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def _recalculate_training_steps(self):
"You must specify either --max_train_steps or --num_train_epochs with a value > 0"
)
self.config.num_train_epochs = math.ceil(
self.config.max_train_steps / self.config.num_update_steps_per_epoch
self.config.max_train_steps / max(self.config.num_update_steps_per_epoch, 1)
)
logger.info(
f"Calculated our maximum training steps at {self.config.max_train_steps} because we have"
Expand Down
Loading