Skip to content

Commit

Permalink
[fix] remove "with_suffix" (pytorch#2146)
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 5e8c59b commit 7589cb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions torchtune/training/checkpointing/_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,8 @@ def save_checkpoint(
index_file_name = TORCH_INDEX_FNAME

index_path = Path.joinpath(
self._output_dir,
f"epoch_{epoch}",
index_file_name,
).with_suffix(".json")
self._output_dir, f"epoch_{epoch}", index_file_name
)

index_data = {
"metadata": {"total_size": total_size},
Expand Down
4 changes: 2 additions & 2 deletions torchtune/training/checkpointing/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
# https://github.com/huggingface/peft/blob/d13d7a401ccf4808aaaf76480fea09a4cf4ac1f5/src/peft/config.py#L259C21-L259C32
ADAPTER_CONFIG_FNAME = "adapter_config"
ADAPTER_MODEL_FNAME = "adapter_model"
SAFETENSOR_INDEX_FNAME = "model.safetensors.index"
TORCH_INDEX_FNAME = "pytorch_model.bin.index"
SAFETENSOR_INDEX_FNAME = "model.safetensors.index.json"
TORCH_INDEX_FNAME = "pytorch_model.bin.index.json"

# standardize checkpointing
SHARD_FNAME = "ft-model-{cpt_idx}-of-{num_shards}"
Expand Down

0 comments on commit 7589cb3

Please sign in to comment.