Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update save.py

Daniel Han-Chen308ed4d15dfb
diff --git a/unsloth/save.py b/unsloth/save.py
index a2c55bb539b..0e131fe309c 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!