[Core] Use weights_only=True with torch.load (#32045)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2026-01-09 19:28:57 -05:00
committed by GitHub
parent 0308901975
commit 1963245ed1

View File

@@ -762,7 +762,7 @@ def tensorize_lora_adapter(lora_path: str, tensorizer_config: TensorizerConfig):
if tensor_path.endswith(".safetensors"):
tensors = safetensors.torch.load_file(tensor_path)
elif tensor_path.endswith(".bin"):
tensors = torch.load(tensor_path)
tensors = torch.load(tensor_path, weights_only=True)
else:
raise ValueError("Unsupported file: %s", tensor_path)