From 452b6ab1159fc9cb1121733198c0830be6374086 Mon Sep 17 00:00:00 2001 From: albanD Date: Sat, 1 Apr 2023 20:25:28 -0400 Subject: [PATCH] Use safe loading for .pth checkpoint --- 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 dcef2f6a3..b1841ce3b 100644 --- a/convert-pth-to-ggml.py +++ b/convert-pth-to-ggml.py @@ -264,7 +264,7 @@ def main(): fout.seek(offset_of_tensors) print(f"Processing part {part_id+1} of {n_parts}\n") fname_model = f"{dir_model}/consolidated.0{part_id}.pth" - model = torch.load(fname_model, map_location="cpu") + model = torch.load(fname_model, map_location="cpu", weights_only=True) process_and_write_variables(fout, model, ftype, part_id, n_parts) del model