Set weights_only=True when using torch.load() (#12366)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2025-01-24 02:17:30 +00:00
committed by GitHub
parent 24b0205f58
commit d3d6bb13fb
4 changed files with 10 additions and 6 deletions
+2 -1
View File
@@ -89,6 +89,7 @@ def load_peft_weights(model_id: str,
adapters_weights = safe_load_file(filename, device=device)
else:
adapters_weights = torch.load(filename,
map_location=torch.device(device))
map_location=torch.device(device),
weights_only=True)
return adapters_weights