You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook unsloth/gemma-3-1b-it-unsloth-bnb-4bit #2058
After fine-tuning unsloth/gemma-3-1b-it-unsloth-bnb-4bit on Kaggle, the GGUF conversion process completes successfully, but the model fails to upload to Hugging Face, throwing the following error:
RuntimeError: Unsloth: Failed to convert llama.cpp/unsloth_convert_hf_to_gguf.py to GGUF.
The GGUF file is visible in the output directory, but the push_to_hub_gguf() function fails.
Potential Fix Needed
Running the following before GGUF conversion is mandatory, otherwise, another error appears:
ifTrue: # Change to True to save finetune!model.save_pretrained_merged("gemma-3-finetune", tokenizer)
If this step is skipped, an error occurs RuntimeError: Unsloth: gemma-3-finetune does not exist? when attempting to convert to GGUF.
✅ Is this an issue with push_to_hub_gguf(), or does Unsloth have specific upload limitations?
✅ Is there a manual way to upload the GGUF file to Hugging Face if push_to_hub_gguf() fails?
changed the title [-]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook[/-][+]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+]on Mar 17, 2025
changed the title [-]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/-][+]### **Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook** `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+]on Mar 17, 2025
changed the title [-]### **Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook** `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/-][+]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+]on Mar 17, 2025
I got a similar error on Gemma3(Cuda toolkit 12.4), when model.save_pretrained_gguf("./save_dir", tokenizer, quantization_type="f16"), got error
TypeError: save_to_gguf_generic() got multiple values for argument 'quantization_type'
When model.save_pretrained_gguf("./save_dir", tokenizer, ), use default qunatization_type, got error
AssertionError:
--> 595 assert(type(quantization_type) is str)
You receive this error, because the save_to_gguf_generic receives quantization_type in the second positon, and then you add quantization_type="f16". You can fix this by removing the tokenizer like so: model.save_pretrained_gguf("./save_dir", quantization_type="f16"). The method has been updated and does not accept the tokenizer anymore.
For vision/multimodal models, use tokenizer=processor
3- You can pass it one or several quant methods (as a list):
quantization_method = "q8_0"
or
quantization_method = ["q8_0", "q4_k_m"]
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 Modelfile for you that you can use to create your model in ollama using:
ollama create model_name -f ./Modelfile
5- Use push_to_hub_gguf if 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)
This should now work.
Let me know how it goes for you.
Activity
[-]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook[/-][+]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+][-]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/-][+]### **Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook** `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+][-]### **Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook** `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/-][+]Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook `unsloth/gemma-3-1b-it-unsloth-bnb-4bit`[/+]yungfu commentedon Mar 17, 2025
I got a similar error on Gemma3(Cuda toolkit 12.4),
when
model.save_pretrained_gguf("./save_dir", tokenizer, quantization_type="f16"), got errorWhen
model.save_pretrained_gguf("./save_dir", tokenizer, ), use defaultqunatization_type, got errorbx0-0 commentedon Mar 18, 2025
@shimmyshimmer Is there any solution for this now?
hcstubbe commentedon Mar 28, 2025
You receive this error, because the save_to_gguf_generic receives quantization_type in the second positon, and then you add quantization_type="f16". You can fix this by removing the tokenizer like so:
model.save_pretrained_gguf("./save_dir", quantization_type="f16"). The method has been updated and does not accept the tokenizer anymore.rolandtannous commentedon Oct 15, 2025
@bx0-0 @yungfu
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)
This should now work.
Let me know how it goes for you.
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
samanta-sc commentedon Nov 8, 2025
For pushing push to Huggingface Hub, just removing
repo_idarguments works totally fine.Like this: