-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 pix2struct #34374
Fix pix2struct #34374
Conversation
In transformers v4.46 generation for Pix2Struct fail when setting Code to reproduce this issue : https://huggingface.co/docs/transformers/v4.46.0/en/model_doc/pix2struct#transformers.Pix2StructForConditionalGeneration.forward.example with
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing! Very bad that we don't have generation test mixin in Pix2Struct 😢 , will add tests in the next batch with some left-over VLMs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! can you add the snippet as a test? 🤗
@ArthurZucker I added a small quick test |
there's one thing I don't understand, running the same test with T5 passes even without eval mode, but it was necessary to get it passing for pix2struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, did not have the chance to approve but LGTM 🤗
* fix * fix and test use_cache test * style * remove atol
What does this PR do?
In #34089 some stuff might have not being copied correctly from T5. In pix2struct case past_key_value was being overridden by the first attention block, resulting in failure in cross attention.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.