-
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] LlavaNextProcessor '_get_unpadded_features' method #33263
[fix] LlavaNextProcessor '_get_unpadded_features' method #33263
Conversation
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.
Great, thanks for fixing. There's another PR (#32907) to clean-up the bugs left from the prev refactoring, but I am okay to merge this one now. The other one will take some time to merge :)
The tests didn't show the issue probably because we usually have a square image, instead of 2-1 or 1-2 resolution. @laurentd-lunit can you add a test for this one pls? |
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.
LGTM! Indeed it would be good to have a test to ensure this does not happen again
ce4b9a1
to
31a0aef
Compare
@zucchini-nlp @LysandreJik Thanks for the reviews! I added a test too. |
@laurentd-lunit can you run |
cool, thanks for fixing the copies, will merge the PR now |
…#33263) * [fix] LlavaNextProcessor '_get_unpadded_features' method * [tests] add test_image_token_filling * [chore] style + comment * [minor] improve readability * [chore] run make fix-copies
What does this PR do?
Fixes 33261 (issue)
The typo in
LlavaNextProcessor
's_get_unpadded_features
method can lead to size mismatch between the number of image tokens computed by the processor and the number of image tokens resulting of the vision tower and then leads to an error when applying themasked_scatter
operation (here)Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
I believe @zucchini-nlp would be the right person to tag here.