Skip to content

Commit

Permalink
Fix model saving at end of training
Browse files Browse the repository at this point in the history
  • Loading branch information
danbraunai committed Dec 1, 2024
1 parent 1fee6ab commit 476acdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion simple_stories_train/train_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,11 @@ def get_lr(it: int) -> float:
if (
checkpoints_dir is not None
and master_process
and (config.intermediate_checkpoints and is_checkpoint_step(step) or last_step)
and (
(config.intermediate_checkpoints and is_checkpoint_step(step))
or last_step
or train_loader_depleted
)
):
save_model(checkpoints_dir, raw_model, step=step, wandb_project=config.wandb_project)

Expand Down

0 comments on commit 476acdd

Please sign in to comment.