Skip to content

[gemma3] fix bidirectional attention mask #38080

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

Merged
merged 5 commits into from
May 20, 2025

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

Fixes #38053. Images cannot attend to future images but in current implementation we unmask attention within all images

@github-actions github-actions bot marked this pull request as draft May 12, 2025 11:05
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@zucchini-nlp zucchini-nlp marked this pull request as ready for review May 12, 2025 11:05
@zucchini-nlp
Copy link
Member Author

[run-slow] gemma3

@zucchini-nlp
Copy link
Member Author

run-slow: gemma3

Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/gemma3']
quantizations: [] ...

@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.

@zucchini-nlp
Copy link
Member Author

image

What I got with the current state, and a few more tweaks for gemma3 locally (for the weird image token 🙃 )

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.

Thanks it looks better!

@zucchini-nlp zucchini-nlp merged commit f834d36 into huggingface:main May 20, 2025
14 checks passed
faaany pushed a commit to faaany/transformers that referenced this pull request May 21, 2025
* fix attn mask

* attn viz doesn't show yello cubes between images

* bucketize made it hard with different number of crops

* fixup
xvyv99 pushed a commit to xvyv99/transformers that referenced this pull request May 21, 2025
* fix attn mask

* attn viz doesn't show yello cubes between images

* bucketize made it hard with different number of crops

* fixup
redmoe-moutain pushed a commit to redmoe-moutain/transformers that referenced this pull request Jun 10, 2025
* fix attn mask

* attn viz doesn't show yello cubes between images

* bucketize made it hard with different number of crops

* fixup
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.

Attention mask for multi-image input in gemma3
3 participants