Skip to content

Commit

Permalink
added weights_only=False
Browse files Browse the repository at this point in the history
  • Loading branch information
rithwik-db committed Feb 11, 2025
1 parent 5a83ed8 commit 033e369
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions composer/utils/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,14 @@ def _ensure_valid_checkpoint(checkpoint_filepath: Union[Path, str],
log.debug(f'Checkpoint at {checkpoint_filepath} is valid.')
return checkpoint_filepath

# TODO(Check): Whether the update with weights_only=True is going to be fine.
def _torch_load_with_validation(checkpoint_filepath: Union[Path, str], map_location: str) -> Any:
"""Validates and loads a torch checkpoint.
Args:
checkpoint_filepath (Union[Path,str]): The path to the checkpoint file.
map_location (str): The location to load the checkpoint to.
"""
return torch.load(_ensure_valid_checkpoint(checkpoint_filepath), map_location=map_location)
return torch.load(_ensure_valid_checkpoint(checkpoint_filepath), map_location=map_location, weights_only=False)


def _format_path_with_rank_zero(path: str) -> str:
Expand Down

0 comments on commit 033e369

Please sign in to comment.