Skip to content

Fix max length for BLIP generation#29296

Merged
ArthurZucker merged 10 commits intohuggingface:mainfrom
zucchini-nlp:gen_max_length
Mar 5, 2024
Merged

Fix max length for BLIP generation#29296
ArthurZucker merged 10 commits intohuggingface:mainfrom
zucchini-nlp:gen_max_length

Conversation

@zucchini-nlp
Copy link
Copy Markdown
Member

What does this PR do?

In the previous PR #28994, I did not make changes in multimodal models, which have custom generate and pass in input_embeds. This PR fixes it. Currently the only model in transformers failing in generation from embeds is BLIP2 and its instruct version. I checked other multimodal generation models, everything is fine there.

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@gante

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

Comment thread src/transformers/models/blip_2/modeling_blip_2.py
Comment thread src/transformers/models/blip_2/modeling_blip_2.py Outdated
Comment thread src/transformers/models/blip_2/modeling_blip_2.py Outdated
Comment thread src/transformers/models/blip_2/modeling_blip_2.py Outdated
Comment thread src/transformers/models/instructblip/modeling_instructblip.py Outdated
@gante
Copy link
Copy Markdown
Contributor

gante commented Feb 27, 2024

it also needs a make fixup run :)

zucchini-nlp and others added 3 commits February 27, 2024 23:01
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
Copy link
Copy Markdown
Contributor

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

Thank you for iterating 🙌

@gante gante requested a review from ArthurZucker February 27, 2024 18:16
Copy link
Copy Markdown
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.

LGTM 🤗

@gante
Copy link
Copy Markdown
Contributor

gante commented Mar 4, 2024

@ArthurZucker the failing test is unrelated (safetensors usage test, timeout) and reruning tests doesn't make it green -- would you be able to merge this PR? 🤗

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.

4 participants