Skip to content

[Bugfix] Fix getting vision features in Transformer Multimodal backend#32933

Merged
DarkLight1337 merged 2 commits intovllm-project:mainfrom
zucchini-nlp:get-image-features-v5-update
Jan 23, 2026
Merged

[Bugfix] Fix getting vision features in Transformer Multimodal backend#32933
DarkLight1337 merged 2 commits intovllm-project:mainfrom
zucchini-nlp:get-image-features-v5-update

Conversation

@zucchini-nlp
Copy link
Contributor

@zucchini-nlp zucchini-nlp commented Jan 23, 2026

Makes sure that transformers multimodal backend keeps working after v5 release.

PR huggingface/transformers#42564 changed the output of self.model.get_image_features to tuple | dict format. Prev we expected the output to always be a single tensor or a list of tensors for non-homogeneous image sizes. A simple check if the output is tuple

The default output format currently depends on model.config.return_dict, so I added both formats

cc @hmellor

Signed-off-by: raushan <raushan@huggingface.co>
Signed-off-by: raushan <raushan@huggingface.co>
@zucchini-nlp zucchini-nlp requested a review from hmellor as a code owner January 23, 2026 11:16
@zucchini-nlp zucchini-nlp changed the title [BugFix] Fix getting vision features in Transformer Multimodal backend [Bugfix] Fix getting vision features in Transformer Multimodal backend Jan 23, 2026
@mergify mergify bot added the bug Something isn't working label Jan 23, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request effectively addresses the compatibility issue with the transformers library's v5 release, where the self.model.get_image_features method now returns a tuple or dict instead of a single tensor. The added logic correctly extracts the vision embeddings from these new output formats, ensuring the multimodal backend continues to function as expected. The changes are concise and directly resolve the reported bug.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

@DarkLight1337
Copy link
Member

Nice

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) January 23, 2026 11:51
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 23, 2026
@DarkLight1337 DarkLight1337 merged commit d95d650 into vllm-project:main Jan 23, 2026
60 checks passed
cwazai pushed a commit to cwazai/vllm that referenced this pull request Jan 25, 2026
vllm-project#32933)

Signed-off-by: raushan <raushan@huggingface.co>
Signed-off-by: 陈建华 <1647430658@qq.com>
lapy pushed a commit to lapy/vllm that referenced this pull request Jan 27, 2026
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants