mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-24 10:24:35 +00:00
python/pytorch compat notes (#44)
This commit is contained in:
parent
129c7d1ea8
commit
b9bd1d0141
@ -136,6 +136,7 @@ ls ./models
|
|||||||
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model
|
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model
|
||||||
|
|
||||||
# install Python dependencies
|
# install Python dependencies
|
||||||
|
# preferred versions: python 3.10 (not 3.11), torch 1.13.1+
|
||||||
python3 -m pip install torch numpy sentencepiece
|
python3 -m pip install torch numpy sentencepiece
|
||||||
|
|
||||||
# convert the 7B model to ggml FP16 format
|
# convert the 7B model to ggml FP16 format
|
||||||
|
@ -86,6 +86,7 @@ for p in range(n_parts):
|
|||||||
if (p > 0):
|
if (p > 0):
|
||||||
fname_out = sys.argv[1] + "/ggml-model-" + ftype_str[ftype] + ".bin" + "." + str(p)
|
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)
|
model = torch.load(fname_model, map_location="cpu", weights_only=True)
|
||||||
|
|
||||||
fout = open(fname_out, "wb")
|
fout = open(fname_out, "wb")
|
||||||
|
Loading…
Reference in New Issue
Block a user