Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paligemma: fix generation with Gemma2 #36044

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

Fixes #36029 and adds tests for the model, imo we need tests with different LM backbone because Gemma-2 is special

This is a quick fix but I think we should make this kind of fix on LM work out-of-the-box, by adding it as kwargs for example. Most LMs accept loss_kwargs thus we can make all multimodal models also accept kwargs that are simply passed further to the LM. WDYT?

@zucchini-nlp zucchini-nlp added the for patch Tag issues / labels that should be included in the next patch label Feb 5, 2025
@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.

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.

we can just use kwargs no?

@zucchini-nlp
Copy link
Member Author

I think making it explicit that kwargs will be used by an only an LM was better

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Fine with me! Thanks a lot!

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's say that an integration test is most welcome as well!

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, was quite low in priority for the patch so I decided to skip it for now :)

@ArthurZucker ArthurZucker merged commit 3dd1de3 into huggingface:main Feb 6, 2025
16 checks passed
@ArthurZucker
Copy link
Collaborator

For transparency, this commit needs to be modified for the patch, only applying changes for PaliGemnma2

ArthurZucker pushed a commit that referenced this pull request Feb 6, 2025
* fix paligemma

* nit

* use `kwargs` in models that can load any LM

* update changes to only affect Paligenma
MekkCyber pushed a commit that referenced this pull request Feb 7, 2025
* fix paligemma

* nit

* use `kwargs` in models that can load any LM
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
* fix paligemma

* nit

* use `kwargs` in models that can load any LM
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Feb 16, 2025
* fix paligemma

* nit

* use `kwargs` in models that can load any LM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for patch Tag issues / labels that should be included in the next patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PaliGemma2 doesn't work with transformers v4.48.2
5 participants