Skip to content

Commit

Permalink
Fix: Update torch.load to use weights_only=True to prevent security w…
Browse files Browse the repository at this point in the history
…arning
  • Loading branch information
yaslack committed Nov 20, 2024
1 parent 173ff7d commit 83876b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def load_model(
with (
io.BytesIO(checkpoint_file) if in_memory else open(checkpoint_file, "rb")
) as fp:
checkpoint = torch.load(fp, map_location=device)
checkpoint = torch.load(fp, map_location=device, weights_only=True)
del checkpoint_file

dims = ModelDimensions(**checkpoint["dims"])
Expand Down

0 comments on commit 83876b4

Please sign in to comment.