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.
Console Output Before the Error
Unsloth: GGUF conversion: 100%
100/100 [00:08<00:00, 10.28it/s, 2.00G/2.00G]
Unsloth: GGUF conversion: 100%
100/100 [00:09<00:00, 10.51it/s, 2.00G/2.00G]
Even though the GGUF file is created successfully, the upload to Hugging Face fails when running:
model.push_to_hub_gguf(
"gemma-3-finetune",
quantization_type = "F16", # Only Q8_0, BF16, F16 supported
repo_id = "",
token = "your_hf_token",
)
Key Observations
-
Conversion Completes, but Upload Fails
- 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:
if True: # 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?
Reference Notebook:
[Kaggle Notebook for Fine-Tuning Gemma 3B](https://www.kaggle.com/notebooks/welcome?src=https://github.com/unslothai/notebooks/blob/main/nb/Kaggle-Gemma3_(4B).ipynb&accelerator=nvidiaTeslaT4)
Any insights or fixes would be greatly appreciated!
After fine-tuning
unsloth/gemma-3-1b-it-unsloth-bnb-4biton Kaggle, the GGUF conversion process completes successfully, but the model fails to upload to Hugging Face, throwing the following error:Console Output Before the Error
Even though the GGUF file is created successfully, the upload to Hugging Face fails when running:
Key Observations
Conversion Completes, but Upload Fails
push_to_hub_gguf()function fails.Potential Fix Needed
RuntimeError: Unsloth:gemma-3-finetunedoes not exist?when attempting to convert to GGUF.✅ Is this an issue with
push_to_hub_gguf(), or doesUnslothhave specific upload limitations?✅ Is there a manual way to upload the GGUF file to Hugging Face if
push_to_hub_gguf()fails?Reference Notebook:
[Kaggle Notebook for Fine-Tuning Gemma 3B](https://www.kaggle.com/notebooks/welcome?src=https://github.com/unslothai/notebooks/blob/main/nb/Kaggle-Gemma3_(4B).ipynb&accelerator=nvidiaTeslaT4)
Any insights or fixes would be greatly appreciated!