Skip to content

Commit

Permalink
fix(io): load weights only in torch.load
Browse files Browse the repository at this point in the history
  • Loading branch information
shavit authored and eginhard committed Sep 12, 2024
1 parent 8025277 commit d2e4062
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trainer/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def load_fsspec(
filecache={"cache_storage": str(get_user_data_dir("tts_cache"))},
mode="rb",
) as f:
return torch.load(f, map_location=map_location, **kwargs)
return torch.load(f, map_location=map_location, weights_only=True, **kwargs)
else:
with fsspec.open(str(path), "rb") as f:
return torch.load(f, map_location=map_location, **kwargs)
return torch.load(f, map_location=map_location, weights_only=True, **kwargs)


def load_checkpoint(
Expand Down

0 comments on commit d2e4062

Please sign in to comment.