Skip to content

Commit

Permalink
Merge branch 'main' into save-peft-only
Browse files Browse the repository at this point in the history
  • Loading branch information
irenedea authored Jul 15, 2024
2 parents a38494a + d271210 commit 444e1a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llmfoundry/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@ def train(cfg: DictConfig) -> Trainer:
hf_checkpointer_callback._save_checkpoint(trainer.state, trainer.logger)
return trainer

if train_cfg.only_composer_checkpoint:
log.info('Not training. Only saving composer checkpoint.')
trainer.save_checkpoint_to_save_folder()
log.info('Done saving checkpoint.')
return trainer

if train_cfg.log_config:
log.info('Logging config')
log_config(logged_cfg)
Expand Down
1 change: 1 addition & 0 deletions llmfoundry/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class TrainConfig:
load_ignore_keys: Optional[List[str]] = None
save_ignore_keys: Optional[List[str]] = None
only_hf_checkpoint: bool = False
only_composer_checkpoint: bool = False

# Dataloader
device_train_microbatch_size: Union[str, int, float] = 'auto'
Expand Down

0 comments on commit 444e1a5

Please sign in to comment.