From 4196d89053a90b02193ffd068a4b6f322f1a7fbf Mon Sep 17 00:00:00 2001 From: bghira Date: Mon, 20 Jan 2025 15:26:06 +0000 Subject: [PATCH] fix divide by zero when reducing dataloader length --- helpers/training/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/training/trainer.py b/helpers/training/trainer.py index f0f35771..a492c2af 100644 --- a/helpers/training/trainer.py +++ b/helpers/training/trainer.py @@ -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"