Skip to content

Conversation

@LysandreJik
Copy link
Member

The gemma3_text tokenizer was not in the tokenizer mapping, leading to errors when trying to load text-only models such as google/gemma-3-1b-it

cc @zucchini-nlp @ArthurZucker

To reproduce the error before this PR:

from transformers import pipeline
pipe = pipeline("text-generation", model="google/gemma-3-1b-it")

messages = [
    [
        {
            "role": "system",
            "content": [{"type": "text", "text": "You are a helpful assistant."},]
        },
        {
            "role": "user",
            "content": [{"type": "text", "text": "Write a poem on Hugging Face, the company"},]
        },
    ],
]

output = pipe(messages, max_new_tokens=15)
print(output)

@github-actions github-actions bot marked this pull request as draft March 18, 2025 10:49
@github-actions
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@LysandreJik LysandreJik marked this pull request as ready for review March 18, 2025 10:50
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep thanks

@ArthurZucker ArthurZucker merged commit bd92073 into main Mar 18, 2025
10 checks passed
@ArthurZucker ArthurZucker deleted the fix-gemma3_text-tokenizer branch March 18, 2025 10:50
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants