Fix FutureWarning in torch.load by setting weights_only=True (#1295)

This commit is contained in:
Usama Ahmed 2025-02-22 17:08:54 +03:00 committed by GitHub
parent 3d793ecf68
commit 09b641aaa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,7 +121,7 @@ if __name__ == "__main__":
mlx_path.mkdir(parents=True, exist_ok=True)
print("[INFO] Loading")
torch_weights = torch.load(torch_path / "pytorch_model.bin")
torch_weights = torch.load(torch_path / "pytorch_model.bin", weights_only=True)
print("[INFO] Converting")
mlx_weights = {
k: torch_to_mx(v, dtype=args.dtype) for k, v in torch_weights.items()