8000 use weights_only in conversion script (#32) · mthomas100/llama.cpp@a931202 · GitHub
[go: up one dir, main page]

Skip to content

Commit a931202

Browse files
authored
use weights_only in conversion script (ggml-org#32)
this restricts malicious weights from executing arbitrary code by restricting the unpickler to only loading tensors, primitive types, and dictionaries
1 parent 6a9a67f commit a931202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert-pth-to-ggml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_n_parts(dim):
8686
if (p > 0):
8787
fname_out = sys.argv[1] + "/ggml-model-" + ftype_str[ftype] + ".bin" + "." + str(p)
8888

89-
model = torch.load(fname_model, map_location="cpu")
89+
model = torch.load(fname_model, map_location="cpu", weights_only=True)
9090

9191
fout = open(fname_out, "wb")
9292

0 commit comments

Comments
 (0)
0