Skip to content

Commit

Permalink
remove "with_suffix"
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Mello committed Dec 10, 2024
1 parent 5370e0d commit 3e0aae6
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 @@ -743,10 +743,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 3e0aae6

Please sign in to comment.