mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 01:17:28 +08:00
Fix FutureWarning in torch.load by setting weights_only=True (#1295)
This commit is contained in:
parent
3d793ecf68
commit
09b641aaa7
@ -121,7 +121,7 @@ if __name__ == "__main__":
|
|||||||
mlx_path.mkdir(parents=True, exist_ok=True)
|
mlx_path.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
print("[INFO] Loading")
|
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")
|
print("[INFO] Converting")
|
||||||
mlx_weights = {
|
mlx_weights = {
|
||||||
k: torch_to_mx(v, dtype=args.dtype) for k, v in torch_weights.items()
|
k: torch_to_mx(v, dtype=args.dtype) for k, v in torch_weights.items()
|
||||||
|
Loading…
Reference in New Issue
Block a user