Skip to content

Commit

Permalink
hardcod to look for recipe_state.pt if its not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Mello committed Dec 6, 2024
1 parent afd6623 commit 03ce473
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions torchtune/training/checkpointing/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,9 @@ def get_recipe_checkpoint_path(
if recipe_checkpoint:
recipe_checkpoint_path = os.path.join(output_dir, recipe_checkpoint)
else:
# Look for the recipe_state in /recipe_state
tentative_folder_path = os.path.join(output_dir, RECIPE_STATE_DIRNAME)
for file_name in os.listdir(tentative_folder_path):
if file_name.startswith("recipe_state" + "."):
recipe_checkpoint_path = os.path.join(tentative_folder_path, file_name)
recipe_checkpoint_path = os.path.join(
output_dir, RECIPE_STATE_DIRNAME, "recipe_state.pt"
)

# TODO: improve this msg
if not recipe_checkpoint_path or not os.path.exists(recipe_checkpoint_path):
Expand Down

0 comments on commit 03ce473

Please sign in to comment.