Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milocress committed Dec 9, 2024
1 parent b489a9a commit e3a1dae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llmfoundry/command_utils/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def train(cfg: DictConfig) -> Trainer:
msg = str(e)
if 'The max_duration' in msg and 'is less than or equal to the elapsed training duration' in msg and train_cfg.run_is_retry:
log.info(
'Training is already complete and detected retry. Skipping training and saving checkpoint.'
'Training is already complete and detected retry. Skipping training and saving checkpoint.',
)
trainer.save_checkpoint_to_save_folder()

Expand All @@ -655,13 +655,13 @@ def train(cfg: DictConfig) -> Trainer:
]
if len(hf_checkpointer_callbacks) == 0:
log.info(
'No HuggingFaceCheckpointer callback found. Skipping HF checkpoint.'
'No HuggingFaceCheckpointer callback found. Skipping HF checkpoint.',
)
return trainer
if len(hf_checkpointer_callbacks) > 1:
raise ValueError(
'Multiple HuggingFaceCheckpointer callbacks found, but only_hf_checkpoint was set to True. Please remove all but one HuggingFaceCheckpointer.',
)
) from e

hf_checkpointer_callback = hf_checkpointer_callbacks[0]
hf_checkpointer_callback._save_checkpoint(
Expand Down

0 comments on commit e3a1dae

Please sign in to comment.