Skip to content

Commit

Permalink
py : removed unused model variable and verified that the code funct…
Browse files Browse the repository at this point in the history
…ions 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. (ggerganov#547)
  • Loading branch information
fritzprix authored Mar 28, 2023
1 parent 96f9c05 commit 692ce31
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions convert-pth-to-ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 692ce31

Please sign in to comment.