winglian commited on
Commit
7882181
1 Parent(s): 5159d00

fix for zero value warmup steps

Browse files
Files changed (1) hide show
  1. src/axolotl/utils/trainer.py +3 -3
src/axolotl/utils/trainer.py CHANGED
@@ -15,9 +15,9 @@ def setup_trainer(cfg, train_dataset, eval_dataset, model, tokenizer):
15
  total_num_steps = int(
16
  math.ceil(len(train_dataset) * cfg.num_epochs / cfg.batch_size)
17
  )
18
- warmup_steps = cfg.warmup_steps if cfg.warmup_steps else min(int(0.03 * total_num_steps), 100)
19
- logging_steps = cfg.logging_steps if cfg.logging_steps else max(min(int(0.005 * total_num_steps), 10), 1)
20
- save_steps = eval_steps = cfg.save_steps if cfg.save_steps else min(int(0.05 * total_num_steps), 200)
21
 
22
  training_arguments_kwargs = {}
23
  if cfg.bf16 == "full":
 
15
  total_num_steps = int(
16
  math.ceil(len(train_dataset) * cfg.num_epochs / cfg.batch_size)
17
  )
18
+ warmup_steps = cfg.warmup_steps if cfg.warmup_steps is not None else min(int(0.03 * total_num_steps), 100)
19
+ logging_steps = cfg.logging_steps if cfg.logging_steps is not None else max(min(int(0.005 * total_num_steps), 10), 1)
20
+ save_steps = eval_steps = cfg.save_steps if cfg.save_steps is not None else min(int(0.05 * total_num_steps), 200)
21
 
22
  training_arguments_kwargs = {}
23
  if cfg.bf16 == "full":