Skip to content

🚨 [v5] Remove headmasking#41076

Merged
vasqu merged 24 commits intohuggingface:mainfrom
vasqu:remove-headmask
Sep 30, 2025
Merged

🚨 [v5] Remove headmasking#41076
vasqu merged 24 commits intohuggingface:mainfrom
vasqu:remove-headmask

Conversation

@vasqu
Copy link
Contributor

@vasqu vasqu commented Sep 22, 2025

As per title, time to deprecate this

This includes anything in the docs, tests, and modeling

  • xxx head mask
  • xxx_headmasking
  • xxx_head_mask

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

@vasqu vasqu marked this pull request as ready for review September 24, 2025 16:59
@vasqu vasqu requested review from Cyrilvallez and zucchini-nlp and removed request for Rocketknight1 September 24, 2025 17:00
@vasqu
Copy link
Contributor Author

vasqu commented Sep 24, 2025

Currently, a lot of tests fail because of rate limits. Checked with everything before the rates change so should hopefully be good 🤞

Edit: works now

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Cyrilvallez
Copy link
Member

Any way you could fix all conflicts before review? 😬 Sorry, this is the cost of such big PRs, any other PR anywhere is likely to create conflicts 🥲

@vasqu
Copy link
Contributor Author

vasqu commented Sep 29, 2025

@Cyrilvallez no worries, getting used to it 😅 resolved the conflicts and updated the recent new models as well

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: albert, align, altclip, audio_spectrogram_transformer, autoformer, bark, bart

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.

Very very nice PR! Very happy to remove it and simplify a lot all these old models!! 🤗🤗🧹🧹

Comment on lines -402 to -406
# check if head_mask has a correct number of layers specified if desired
if head_mask is not None:
assert head_mask.size()[0] == (len(self.layers)), (
f"The head_mask should be specified for {len(self.layers)} layers, but it is for {head_mask.size()[0]}."
)
Copy link
Member

Choose a reason for hiding this comment

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

Oh wow, did not know that some qwen models got head_mask...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me neither, I suspect(ed) some inheritance from whisper 😢

@vasqu vasqu merged commit 52f5eca into huggingface:main Sep 30, 2025
25 checks passed
@vasqu vasqu deleted the remove-headmask branch September 30, 2025 14:05
@vasqu vasqu added the for_v5? label Sep 30, 2025
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Sep 30, 2025
* first attempt at removing

* copies

* last bits in core

* quick fixes

* tests purge

* docs and examples

* some fixes

* more

* another round of cleanups

* fix

* fix a bunch of models

* fix dummy bert

* fix

* fix new model

* fix signature change

* fix

* fix style/copies

* new models

* fix copies didnt find that damn

* test

* this shouldnt have happened during model addition
vijayabhaskar-ev pushed a commit to vijayabhaskar-ev/transformers that referenced this pull request Oct 2, 2025
* first attempt at removing

* copies

* last bits in core

* quick fixes

* tests purge

* docs and examples

* some fixes

* more

* another round of cleanups

* fix

* fix a bunch of models

* fix dummy bert

* fix

* fix new model

* fix signature change

* fix

* fix style/copies

* new models

* fix copies didnt find that damn

* test

* this shouldnt have happened during model addition
yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this pull request Oct 4, 2025
* first attempt at removing

* copies

* last bits in core

* quick fixes

* tests purge

* docs and examples

* some fixes

* more

* another round of cleanups

* fix

* fix a bunch of models

* fix dummy bert

* fix

* fix new model

* fix signature change

* fix

* fix style/copies

* new models

* fix copies didnt find that damn

* test

* this shouldnt have happened during model addition
@vasqu vasqu mentioned this pull request Oct 9, 2025
AhnJoonSung pushed a commit to AhnJoonSung/transformers that referenced this pull request Oct 12, 2025
* first attempt at removing

* copies

* last bits in core

* quick fixes

* tests purge

* docs and examples

* some fixes

* more

* another round of cleanups

* fix

* fix a bunch of models

* fix dummy bert

* fix

* fix new model

* fix signature change

* fix

* fix style/copies

* new models

* fix copies didnt find that damn

* test

* this shouldnt have happened during model addition
@yonigozlan yonigozlan mentioned this pull request Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants