From: DooWoong Lee (David) Date: Tue, 28 Mar 2023 17:02:34 +0000 (+0900) Subject: py : removed unused `model` variable and verified that the code functions correctly... X-Git-Tag: gguf-v0.4.0~1076 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=692ce3164ef1201ecb9cfad315cc0a08b965adb8;p=pkg%2Fggml%2Fsources%2Fllama.cpp py : removed unused `model` variable and verified that the code functions correctly with `vocab_only` setting. Also confirmed that the code works as expected after running with reduced memory usage due to deletion of no-longer-needed variable. (#547) --- diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py index ccf2c57b..d83f8a13 100644 --- a/convert-pth-to-ggml.py +++ b/convert-pth-to-ggml.py @@ -145,13 +145,11 @@ def main(): print(f"Extracting only the vocab from '{fname_model}'\n") - model = torch.load(fname_model, map_location="cpu") with open(fname_out, "wb") as fout: write_header(fout, hparams, ftype) write_tokens(fout, tokenizer) - del model print(f"Done. Output file: {fname_out}\n")