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

Fix position embeddings singular/plural #33678

Merged
merged 13 commits into from
Sep 26, 2024
Merged

Conversation

molbap
Copy link
Contributor

@molbap molbap commented Sep 24, 2024

What does this PR do?

It seems a few Blip-derived models have both self.position_embedding and self.position_embeddings, plural, defined in the same module and causing some errors. This aims at fixing those. Noticed it in #31368 .

Causes many things to break because self.position_embedding isn't defined since it's self.position_embeddings (with an s) instead.

@molbap
Copy link
Contributor Author

molbap commented Sep 24, 2024

cc @amyeroberts for review!

@molbap molbap requested a review from amyeroberts September 24, 2024 13:19
@molbap molbap mentioned this pull request Sep 24, 2024
5 tasks
@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.

@molbap
Copy link
Contributor Author

molbap commented Sep 25, 2024

@amyeroberts sorry for the ping, just keeping this one higher in the notifications - hub tests were just flaky :)

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@molbap
Copy link
Contributor Author

molbap commented Sep 26, 2024

Found out about an issue in test_expansion_in_processing for instructblip @zucchini-nlp and fixed it here, not a big deal I think but FYI (list + tensor concat messing expansion!)

@molbap molbap merged commit 9f97c39 into huggingface:main Sep 26, 2024
24 checks passed
@molbap molbap deleted the fix_blip branch September 26, 2024 17:07
BenjaminBossan pushed a commit to BenjaminBossan/transformers that referenced this pull request Sep 30, 2024
* fix position embeddings

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix init

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix copies

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* handle exception where list + tensors are cat'd

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* add missing default

* [run-slow] blip, blip_2, instructblip, instructblipvideo
amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Oct 2, 2024
* fix position embeddings

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix init

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix copies

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* handle exception where list + tensors are cat'd

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* add missing default

* [run-slow] blip, blip_2, instructblip, instructblipvideo
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* fix position embeddings

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix init

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix copies

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* handle exception where list + tensors are cat'd

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* add missing default

* [run-slow] blip, blip_2, instructblip, instructblipvideo
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
* fix position embeddings

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix init

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* fix copies

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* handle exception where list + tensors are cat'd

* [run-slow] blip, blip_2, instructblip, instructblipvideo

* add missing default

* [run-slow] blip, blip_2, instructblip, instructblipvideo
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.

3 participants