From: deepdiffuser Date: Sun, 12 Mar 2023 06:36:35 +0000 (-0800) Subject: use weights_only in conversion script (#32) X-Git-Tag: gguf-v0.4.0~1278 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=a93120236f99e13d77e4b278e47ffcaad4a899e4;p=pkg%2Fggml%2Fsources%2Fllama.cpp 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 --- diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py index fc217c7e..98693e30 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")