From 09b641aaa74f9737f747b62ad8c628405e7e25be Mon Sep 17 00:00:00 2001 From: Usama Ahmed <53372259+0ssamaak0@users.noreply.github.com> Date: Sat, 22 Feb 2025 17:08:54 +0300 Subject: [PATCH] Fix FutureWarning in torch.load by setting weights_only=True (#1295) --- clip/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clip/convert.py b/clip/convert.py index 29bac22e..976d7494 100644 --- a/clip/convert.py +++ b/clip/convert.py @@ -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()