Fix: warmup_steps: 0 & warmup_ratio: 0 not disabling warmup (#3254)

* fix unintentional falsy checks

* chore: lint

---------

Co-authored-by: NanoCode012 <nano@axolotl.ai>
This commit is contained in:
xzuyn
2025-11-10 22:32:06 -05:00
committed by GitHub
parent b54f9c942b
commit dd78f2e0cc
2 changed files with 3 additions and 2 deletions

View File

@@ -196,9 +196,9 @@ class TrainerBuilderBase(abc.ABC):
):
warmup_steps = 0
warmup_ratio = 0.0
if self.cfg.warmup_steps:
if self.cfg.warmup_steps is not None:
warmup_steps = self.cfg.warmup_steps
elif self.cfg.warmup_ratio:
elif self.cfg.warmup_ratio is not None:
if total_num_steps:
warmup_steps = max(int(self.cfg.warmup_ratio * total_num_steps), 0)
else: