Repository navigation
Fix Idefics2 padding when the first example has no image - #48753
zucchini-nlp merged 8 commits into
Conversation
zucchini-nlp
left a comment
There was a problem hiding this comment.
The support has been added already (in #36682) and there is a test as well, can you double-check if the test is running on Idefics2 and provide a clear reproducer of the "bug"?
|
If it is just a PR trying to solve an old GH issue, better to simply close it! The issue is too old and has been resolved |
Hi! I double-checked, and [[], [image]] still raises IndexError in both Idefics2 image-processing backends. I also ran test_processor_text_has_no_visual for Idefics2. It is collected but skipped because the guard needs both images and videos in the processor signature. Here's a small reproducer: Both of them fail during padding when accessing the first image of the empty first row. My changes change it so that both return shape (2, 1, 3, 8, 10) with a zero pixel-attention mask for the text-only row. |
nooooooo 😿 Oke, in that case would you be open to re-make the test and allow image-only inputs as well? That feature should be working in all VLMs, no matter if video is supported or not |
Sure! |
Just pushed the changes! |
|
We'll defi need to fix failing models now, there should be more than only Idefics2 |
Pushed the follow-up! NeoMME already supports mixed document batches, but inputs didn’t match its retrieval format. I modified its test to cover both direct inputs and its supported chat format GLM-Image requires equal source-image counts across the batch for image generation. I kept that restriction and made a test that ensures it holds up that restriction! Tests pass: 88 pass 103 skip |
zucchini-nlp
left a comment
There was a problem hiding this comment.
thanks! no need for new tests though right?
|
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. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: glm_image, idefics2, lighton_ocr, neomme, pi0 |
CI recapDashboard: View test results in Grafana |
Idefics2 raises
IndexErrorfor[[], [image]]because padding assumes the first batch row contains an image. Use the first available image for channels/device in both backends, preserving image outputs and zero masks for text-only examples.Related to #31854
Tests
3 failures -> 3 passes
python -m pytest -q tests/models/idefics2/test_image_processing_idefics2.py: 25 passed, 3 skipped.python -m pytest -q tests/models/idefics2/test_processing_idefics2.py: 31 passed, 31 skipped.make fix-repoandmake typing: passed.CPU only
AI disclosure
AI helped in the development of tests and code