From 6905711e45352b683d7b91a80a7d64419afe1992 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 6 Feb 2025 17:27:52 -0500 Subject: [PATCH] set max steps to -1 when empty --- src/axolotl/core/trainer_builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/axolotl/core/trainer_builder.py b/src/axolotl/core/trainer_builder.py index 881114634..5345165f1 100755 --- a/src/axolotl/core/trainer_builder.py +++ b/src/axolotl/core/trainer_builder.py @@ -1032,10 +1032,11 @@ class HFRLTrainerBuilder(TrainerBuilderBase): if blocklist_key in training_args_kwargs: del training_args_kwargs[blocklist_key] + max_steps = self.cfg.max_steps or total_num_steps or -1 training_args = training_args_cls( # pylint: disable=unexpected-keyword-arg self.cfg.output_dir, per_device_train_batch_size=self.cfg.micro_batch_size, - max_steps=self.cfg.max_steps or total_num_steps, + max_steps=max_steps, gradient_accumulation_steps=self.cfg.gradient_accumulation_steps, learning_rate=self.cfg.learning_rate, warmup_steps=self.cfg.warmup_steps,