From a93120236f99e13d77e4b278e47ffcaad4a899e4 Mon Sep 17 00:00:00 2001 From: deepdiffuser <112834445+deepdiffuser@users.noreply.github.com> Date: Sat, 11 Mar 2023 22:36:35 -0800 Subject: [PATCH] use weights_only in conversion script (#32) this restricts malicious weights from executing arbitrary code by restricting the unpickler to only loading tensors, primitive types, and dictionaries --- convert-pth-to-ggml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py index fc217c7..98693e3 100644 --- a/convert-pth-to-ggml.py +++ b/convert-pth-to-ggml.py @@ -86,7 +86,7 @@ for p in range(n_parts): if (p > 0): fname_out = sys.argv[1] + "/ggml-model-" + ftype_str[ftype] + ".bin" + "." + str(p) - model = torch.load(fname_model, map_location="cpu") + model = torch.load(fname_model, map_location="cpu", weights_only=True) fout = open(fname_out, "wb")