Skip to content

Commit

Permalink
python/pytorch compat notes (ggerganov#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzard0 authored Mar 12, 2023
1 parent 129c7d1 commit b9bd1d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ ls ./models
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model

# install Python dependencies
# preferred versions: python 3.10 (not 3.11), torch 1.13.1+
python3 -m pip install torch numpy sentencepiece

# convert the 7B model to ggml FP16 format
Expand Down
1 change: 1 addition & 0 deletions convert-pth-to-ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_n_parts(dim):
if (p > 0):
fname_out = sys.argv[1] + "/ggml-model-" + ftype_str[ftype] + ".bin" + "." + str(p)

# weights_only requires torch 1.13.1, remove this param or update if you get an "invalid keyword argument" error
model = torch.load(fname_model, map_location="cpu", weights_only=True)

fout = open(fname_out, "wb")
Expand Down

0 comments on commit b9bd1d0

Please sign in to comment.