aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeepdiffuser <112834445+deepdiffuser@users.noreply.github.com>2023-03-11 22:36:35 -0800
committerGitHub <noreply@github.com>2023-03-12 08:36:35 +0200
commita93120236f99e13d77e4b278e47ffcaad4a899e4 (patch)
treebc7e56a73dd33589d0b5897006550b9161e8a0ed
parent6a9a67f0bee5eed67cf8bf03f74f77619da40d3f (diff)
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
-rw-r--r--convert-pth-to-ggml.py2
1 files changed, 1 insertions, 1 deletions
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")