Skip to content

[Bug] save_pretrained_gguf Broken - (Tokenizer?), doesn't support gemma-3 anymore #3348

@orenong

Description

@orenong

The Gemma-3 notebooks use this for saving:


if True: # Change to True to save to GGUF
    model.save_pretrained_gguf(
        "gemma-3-finetune",
        quantization_type = "Q8_0"
)

I added a tokenizer, because it seems to be required now

if True: # Change to True to save to GGUF
    model.save_pretrained_gguf(
        "gemma-3-finetune",
        tokenizer,
        quantization_type = "Q8_0"
)

and the result is a model that when used, returns text that looks like this:

sed24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused24><unused

Looked to me like an issue with the tokenizer. Using a fresh tokenizer results in the same issue.

Example in a notebook

gemma_en_notebook (1).ipynb

Update:

Same issue with different quantizations as well.

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