Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug fix] add parents=True #2136

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions torchtune/training/checkpointing/_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(
self._resume_from_checkpoint = resume_from_checkpoint
self._model_type = ModelType[model_type]
self._output_dir = Path(output_dir)
self._output_dir.mkdir(exist_ok=True)
self._output_dir.mkdir(parents=True, exist_ok=True)

# save all files in input_dir, except model weights and mapping, to output_dir
# this is useful to preserve the tokenizer, configs, license, etc.
Expand Down Expand Up @@ -394,7 +394,7 @@ def __init__(
self._checkpoint_dir = Path(checkpoint_dir)
self._model_type = ModelType[model_type]
self._output_dir = Path(output_dir)
self._output_dir.mkdir(exist_ok=True)
self._output_dir.mkdir(parents=True, exist_ok=True)

# weight_map contains the state_dict key -> checkpoint file mapping so we can correctly
# parition the state dict into output checkpoint files. This is updated during checkpoint
Expand Down Expand Up @@ -913,7 +913,7 @@ def __init__(
self._resume_from_checkpoint = resume_from_checkpoint
self._model_type = ModelType[model_type]
self._output_dir = Path(output_dir)
self._output_dir.mkdir(exist_ok=True)
self._output_dir.mkdir(parents=True, exist_ok=True)

# save all files in input_dir, except model weights and mapping, to output_dir
# this is useful to preserve the tokenizer, configs, license, etc.
Expand Down
Loading