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
@@ -273,7 +273,8 @@ class LoRAModel(AdapterModel):
new_embeddings_tensor_path)
elif os.path.isfile(new_embeddings_bin_file_path):
embeddings = torch.load(new_embeddings_bin_file_path,
map_location=device)
map_location=device,
weights_only=True)
return cls.from_lora_tensors(
lora_model_id=get_lora_id()