Repository navigation
Description
unsloth==2025.5.1
unsloth_zoo==2025.5.1
After I fine-tuned the unsloth/Qwen2.5-VL-3B-Instruct model using unsloth, it runs normally. However, when I try to save it in GGUF format using the following command:
model.save_pretrained_gguf("./save_dir", quantization_type="q8_0")
The following error appears:
RuntimeError Traceback (most recent call last)
Cell In[25], line 1
----> 1 model.save_pretrained_gguf("./save_dir", quantization_type="q8_0")
File ~/anaconda3/envs/mocr/lib/python3.10/site-packages/torch/utils/_contextlib.py:116, in context_decorator..decorate_context(*args, **kwargs)
113 @functools.wraps(func)
114 def decorate_context(*args, **kwargs):
115 with ctx_factory():
--> 116 return func(*args, **kwargs)
File ~/anaconda3/envs/mocr/lib/python3.10/site-packages/unsloth/save.py:2247, in save_to_gguf_generic(model, save_directory, quantization_type, repo_id, token)
2244 install_llama_cpp(just_clone_repo = True)
2245 pass
-> 2247 metadata = _convert_to_gguf(
2248 save_directory,
2249 print_output = True,
2250 quantization_type = quantization_type,
2251 )
2252 if repo_id is not None:
2253 prepare_saving(
2254 model,
2255 repo_id,
2256 is_gguf = True,
2257 save_directory = save_directory,
2258 metadata = metadata,
2259 token = token,
2260 )
File ~/anaconda3/envs/mocr/lib/python3.10/site-packages/unsloth_zoo/llama_cpp.py:692, in convert_to_gguf(input_folder, output_filename, quantization_type, max_shard_size, print_output, print_outputs)
689 pass
691 if metadata is None:
--> 692 raise RuntimeError(f"Unsloth: Failed to convert {conversion_filename} to GGUF.")
694 printed_metadata = "\n".join(metadata)
695 if print_output: print(f"Unsloth: Successfully saved GGUF to:\n{printed_metadata}")
RuntimeError: Unsloth: Failed to convert llama.cpp/unsloth_convert_hf_to_gguf.py to GGUF.
Or when I try to upload it to Hugging Face using the following command:
model.push_to_hub_gguf("haha/qwen2.5-vl-gguf-q8", tokenizer, quantization_type = "Q8_0")
The following error appears:
TypeError Traceback (most recent call last)
Cell In[27], line 1
----> 1 model.push_to_hub_gguf("haha/qwen2.5-vl-gguf-q8", tokenizer, quantization_type = "Q8_0")
File ~/anaconda3/envs/mocr/lib/python3.10/site-packages/torch/utils/_contextlib.py:116, in context_decorator..decorate_context(*args, **kwargs)
113 @functools.wraps(func)
114 def decorate_context(*args, **kwargs):
115 with ctx_factory():
--> 116 return func(*args, **kwargs)
TypeError: save_to_gguf_generic() got multiple values for argument 'quantization_type'
Besides using q8_0, I have also tried bf16 and f16, and the above errors still occur.
However, I can successfully save it in the safetensors format using the following command:
model.save_pretrained_merged("qwen2.5-vl-sat", tokenizer)
This command runs successfully and saves the model.
Is it possible that unsloth does not support saving Qwen2.5-VL models in GGUF format?
Activity
github-actions commentedon Jul 1, 2025
Is this issue still important to you? Apologies in advance we might have missed this issue as well. For faster response times, please post on our Reddit server - https://www.reddit.com/r/unsloth or our Discord - https://discord.com/invite/unsloth
leanhtuan276 commentedon Jul 29, 2025
I have same the problem
rolandtannous commentedon Oct 15, 2025
@JustinYuann @dan1ssimo @leanhtuan276 @zenmequmingzia
We just pushed a major fix for llamacpp integration.
1- Please make sure to update your local install of unsloth
If you're using a notebook on kaggle or colab, it should pull the latest version automatically.
2- You can now use
save_pretrained_ggufto quantize and save to GGUF format:For vision/multimodal models, use
tokenizer=processor3- You can pass it one or several quant methods (as a list):
or
We support all the quants mentioned in this page except the iq variants.
4- If the model is supported by Ollama, it will now also automatically create a
Modelfilefor you that you can use to create your model in ollama using:5- Use
push_to_hub_ggufif you want to convert to gguf and push to Huggingface Hub instead.6- Should work for all models supported by unsloth and ollama.
7- It now fully supports linux debian and RPM variants. We are still testing windows (if someone has a windows machine and is on our discord channel ping me to help debug)
8 - Finally, If you are on a local machine or a cloud VM, are facing frequent dependency problems while installing/updating unsloth and can run containers, I highly recommend that you use our official docker containerized environment. No more dependency conflicts. It's safe (non root user) and comes with a prebuilt pretested environment and the most up to date notebooks for you to run. You can find the Docker container image here: https://hub.docker.com/r/unsloth/unsloth
The how to guide for the docker container can be found here: https://docs.unsloth.ai/get-started/install-and-update/docker
Thanks!
rolandtannous commentedon Oct 23, 2025
Will be closing this for now as the issue has been resolved. Please make sure to follow the instructions given in my last response.
Meanwhile , please feel free to respond if you're still having any issues.
Thank you