Skip to content

Fix Gemma3n audio encoder for Transformers v5#33673

Merged
vllm-bot merged 2 commits intovllm-project:mainfrom
hmellor:gemma3n-v5
Feb 3, 2026
Merged

Fix Gemma3n audio encoder for Transformers v5#33673
vllm-bot merged 2 commits intovllm-project:mainfrom
hmellor:gemma3n-v5

Conversation

@hmellor
Copy link
Member

@hmellor hmellor commented Feb 3, 2026

huggingface/transformers#42564 updated all the multimodal feature getting methods to return BaseModelOutputWithPooling (which is a dict) by default. This is a welcome change as it standardises these methods across all models in Transformers.

However, this caused issues for Gemma3n in vLLM because it instantiates the audio_tower using from_config (therefore using the forward method from Transformers) and expects it to return a tuple.

This PR handles the output of audio_tower.forward differently depending on if it is a tuple.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
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

This pull request addresses a compatibility issue with the upcoming Transformers v5 release for the Gemma3n model. The change ensures that the audio_tower continues to return a tuple as expected by the existing code, by explicitly passing return_dict=False. This is a clean and minimal fix that maintains backward compatibility with Transformers v4. The change is correct and well-justified.

@hmellor hmellor changed the title Fix Gemma3n for Transformers v5 Fix Gemma3n audio encoder for Transformers v5 Feb 3, 2026
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) February 3, 2026 09:23
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 3, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@vllm-bot vllm-bot merged commit 2a8d84e into vllm-project:main Feb 3, 2026
46 of 49 checks passed
PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Pai <416932041@qq.com>
@hmellor hmellor deleted the gemma3n-v5 branch February 3, 2026 16:14
PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Pai <416932041@qq.com>
gameofdimension pushed a commit to gameofdimension/vllm that referenced this pull request Feb 5, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: felix01.yu <felix01.yu@vipshop.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants