8000 [fix] sliding window attention mask by zucchini-nlp · Pull Request #38045 · huggingface/transformers · GitHub
[go: up one dir, main page]

Skip to content

[fix] sliding window attention mask #38045

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 6 commits into from
May 20, 2025

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

Fixes #38002. Sliding mask should not be applied when config.use_sliding_window = False

Added a small test as well

@github-actions github-actions bot marked this pull request as draft May 9, 2025 14:02
Copy link
Contributor
github-actions bot commented May 9, 2025

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 9, 2025 14:03
@zucchini-nlp zucchini-nlp requested review from gante and ArthurZucker May 9, 2025 14:03
@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
Member
@gante gante left a comment

Choose a reason for hiding this comment

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

LGTM, and thank you for adding a test 🙏

zucchini-nlp and others added 2 commits May 13, 2025 13:58
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
Copy link
Collaborator
ArthurZucker left a comment

Choose a reason for hiding this comment

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

Hahah okay I think I reviewed a similar PR recently, saying we should isolate to models that can have sliding_window not defined in the config, but this is better I think.
Mit supprised that moshi or mimi are affected as I did not know they had sliding but they prob do!

@zucchini-nlp zucchini-nlp enabled auto-merge (squash) May 20, 2025 09:21
@zucchini-nlp zucchini-nlp merged commit 0a52bd2 into huggingface:main May 20, 2025
20 checks passed
faaany pushed a commit to faaany/transformers that referenced this pull request May 21, 2025
* fix sliding attn

* make style

* Update tests/test_modeling_common.py

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* no a second throught, should default to `True` fo BC

---------

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
xvyv99 pushed a commit to xvyv99/transformers that referenced this pull request May 21, 2025
* fix sliding attn

* make style

* Update tests/test_modeling_common.py

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* no a second throught, should default to `True` fo BC

---------

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
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.

[bug] use_sliding_window doesn't work as expected
4 participants
0