From 308ed4d15dfbc82d7fd0278e482510a36a3a6b19 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 29 Apr 2024 17:55:04 +1000 Subject: [PATCH] Update save.py --- unsloth/save.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/unsloth/save.py b/unsloth/save.py index a2c55bb539..0e131fe309 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -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!