Skip to content

Commit

Permalink
Fix incorrect checkpoint removal logic (#9192)
Browse files Browse the repository at this point in the history
* Fix incorrect if logic

Signed-off-by: Mikołaj Błaż <[email protected]>

* Apply isort and black reformatting

Signed-off-by: mikolajblaz <[email protected]>

---------

Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: mikolajblaz <[email protected]>
  • Loading branch information
mikolajblaz authored May 15, 2024
1 parent c2daa91 commit 1de4b49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nemo/collections/nlp/parts/nlp_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,9 @@ def load_checkpoint(self, checkpoint_path: Union[str, Path]) -> Dict[str, Any]:

def remove_checkpoint(self, filepath: Union[str, Path]) -> None:
# check if filepath is a distributed checkpoint
if self.use_distributed_checkpointing and self.is_global_zero:
self.checkpoint_io.remove_checkpoint(ckpt_to_dir(filepath))
if self.use_distributed_checkpointing:
if self.is_global_zero:
self.checkpoint_io.remove_checkpoint(ckpt_to_dir(filepath))

# legacy checkpoint logic, does not use megatron core
else:
Expand Down

0 comments on commit 1de4b49

Please sign in to comment.