You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
torch.load without weights_only parameter is unsafe. Explicitly set weights_only to False only if you trust the data you load and full pickle functionality is needed, otherwise set weights_only=True.
gemma/model.py:562:13
--- /home/sdym/repos/google/gemma_pytorch/gemma/model.py
+++ /home/sdym/repos/google/gemma_pytorch/gemma/model.py
@@ -557,9 +557,9 @@
# If a string was provided as input, return a string as output.
return results[0] if is_str_prompt else results
def load_weights(self, model_path: str):
self.load_state_dict(
- torch.load(model_path, mmap=True)['model_state_dict'],
+ torch.load(model_path, mmap=True, weights_only=True)['model_state_dict'],
strict=False,
)
This is found via https://github.com/pytorch-labs/torchfix/
torch.load
withoutweights_only
parameter is unsafe. Explicitly setweights_only
to False only if you trust the data you load and full pickle functionality is needed, otherwise setweights_only=True
.gemma/model.py:562:13
gemma/model_xla.py:517:22
The text was updated successfully, but these errors were encountered: