-
Notifications
You must be signed in to change notification settings - Fork 27.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
PixtralProcessor always returns outputs of length 1 #34204
Closed
2 of 4 tasks
Labels
Comments
Ah this is not expected, would you like to open a PR for a fix? 🤗 |
Sure let me give it a shot |
Ryukijano
added a commit
to Ryukijano/transformers
that referenced
this issue
Oct 22, 2024
Fixes huggingface#34204 Update `PixtralProcessor` to handle batches of images and text prompts correctly. * Modify the `__call__` method in `src/transformers/models/pixtral/processing_pixtral.py` to process each example in a batch individually. * Update the handling of images to correctly iterate over the zip of images, image sizes, and text. * Add a test case in `tests/models/pixtral/test_processor_pixtral.py` to verify the `PixtralProcessor` returns the outputs corresponding to all prompts and images in a batch. * Ensure the test case includes multiple images and text prompts in a batch and verifies the outputs match the expected outputs for all examples in the batch. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/huggingface/transformers/issues/34204?shareId=XXXX-XXXX-XXXX-XXXX).
Merged
Ryukijano
added a commit
to Ryukijano/transformers
that referenced
this issue
Oct 29, 2024
…n batch Related to huggingface#34204 Update `PixtralProcessor` to handle batches of images and text prompts correctly. * **`src/transformers/models/pixtral/processing_pixtral.py`** - Modify the handling of images to correctly iterate over the zip of images, image sizes, and text. - Remove the aggregation of all images into a length 1 list of lists. - Ensure the `PixtralProcessor` processes each example in a batch individually. * **`tests/models/pixtral/test_processor_pixtral.py`** - Add a test case to verify the `PixtralProcessor` returns the outputs corresponding to all prompts and images in a batch. - Ensure the test case includes multiple images and text prompts in a batch. - Verify the outputs of the `PixtralProcessor` match the expected outputs for all examples in the batch. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/huggingface/transformers/issues/34204?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System Info
transformers
version: 4.45.2Who can help?
@ArthurZucker @amyeroberts Hello! I'm working on finetuning a VLM, and during my dataset preprocessing, I'm noticing that the PixtralProcessor always returns the input ids for only the first example in a batch. I think this is being caused by the lines here, which are aggregating all of the images into a length 1 list of lists, which is messing with the iteration over the zip here. Is this unintended behavior or am I doing something wrong?
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
I would expect it to return the outputs corresponding to all 50 prompts and images.
The text was updated successfully, but these errors were encountered: