-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add support for nested images to LLava and VipLLava #35558
base: main
Are you sure you want to change the base?
Add support for nested images to LLava and VipLLava #35558
Conversation
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. |
Flagging this PR too - I made some changes to the Llava/Pixtral processing for nested images here, so there might be some conflicts! #34801 |
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.
Super cool, thanks for cleaning this up. Looks much better now
src/transformers/image_utils.py
Outdated
if is_valid_image(images): | ||
output_images = [[images]] |
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.
could it be that we get a 4D tensor as a batch of images?
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.
Yes you are right! Made some changes that should account for that
0319100
to
6f595da
Compare
What does this PR do?
This PR adds the functions
make_flat_list_of_images
,make_nested_list_of_images
andmake_batched_videos
toimage_utils
, removing some unnecessarily duplicated code.make_flat_list_of_images
also replaces make_list_of_images in clip, blip, and siglip image processors, as it allows image-text-to-text models which use these image processors to support nested images inputs, while preserving BC.Partially addresses #34545
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@zucchini-nlp