transformers
44ee1da4 - Fix Gemma 4 dropping `audio_outputs`, which made `audio_hidden_states` raise (#51301)

Commit
20 hours ago
Fix Gemma 4 dropping `audio_outputs`, which made `audio_hidden_states` raise (#51301) * Return the audio encoder outputs from Gemma 4 and Gemma 4 Unified Since #50379, `Gemma4Model.forward` keeps the audio encoder output in a local `audio_output` but returns `audio_outputs`, which stays None, and `Gemma4ForConditionalGeneration.forward` does not pass `audio_outputs` on. With audio inputs, `outputs.audio_outputs` is therefore None and the deprecated `outputs.audio_hidden_states` raises AttributeError, where v5.23.0 returned the audio features. `Gemma4UnifiedModel` and `Gemma4UnifiedForConditionalGeneration` have the same two lines. Assign the encoder output to `audio_outputs` and pass it through, as Gemma3n does, and test that both classes of both models return it. * Drop the audio_outputs tests, as asked in review --------- Co-authored-by: Xiaoyuan Wang <174581044+XiaoyuanWang111@users.noreply.github.com>
Parents
Loading