Update save.py

This commit is contained in:
Daniel Han-Chen 2024-04-29 17:55:04 +10:00
commit 308ed4d15d

View file

@ -922,9 +922,16 @@ def save_to_gguf(
f"The output location will be {final_location}\n"\
"This will take 3 minutes...")
# We first check if tokenizer.model exists in the model_directory
if os.path.exists(f"{model_directory}/tokenizer.model"):
vocab_type = "spm,hfft,bpe"
else:
vocab_type = "bpe"
pass
if use_fast_convert:
command = f"python llama.cpp/convert.py {model_directory} "\
f"--outfile {final_location} --vocab-type spm,hfft,bpe "\
f"--outfile {final_location} --vocab-type {vocab_type} "\
f"--outtype {first_conversion} --concurrency {n_cpus}"
else:
# Need to fix convert-hf-to-gguf.py for some models!