Skip to content

Commit

Permalink
[bug fix] add parents=True (pytorch#2136)
Browse files Browse the repository at this point in the history
Co-authored-by: Felipe Mello <[email protected]>
  • Loading branch information
2 people authored and rahul-sarvam committed Dec 23, 2024
1 parent ed3b330 commit 629df2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchtune/training/checkpointing/_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,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 @@ -403,7 +403,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 @@ -938,7 +938,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

0 comments on commit 629df2f

Please sign in to comment.