Skip to content

Commit

Permalink
Merge pull request #78 from fabianlim/checkpoint
Browse files Browse the repository at this point in the history
Another Fix for Checkpointing
  • Loading branch information
aldopareja authored Jun 26, 2024
2 parents 7fa8e28 + a95abd8 commit d9237f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/instructlab/training/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ def ensure_loadable_granite_checkpoint(model_name_or_path: str):
if dist.is_initialized():
dist.barrier()
yield tmpdir
shutil.rmtree(tmpdir, ignore_errors=True)
if not dist.is_initialized() or dist.get_rank() == 0:
shutil.rmtree(tmpdir, ignore_errors=True)


# this function is for supporting gradient checkpointing for padding free
Expand Down

0 comments on commit d9237f8

Please sign in to comment.