Skip to content

Error While Converting & Uploading GGUF Model After Fine-Tuning in Kaggle Notebook unsloth/gemma-3-1b-it-unsloth-bnb-4bit #2058

@bx0-0

Description

@bx0-0

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

  1. Conversion Completes, but Upload Fails

    • The GGUF file is visible in the output directory, but the push_to_hub_gguf() function fails.
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions