diff --git a/vllm/model_executor/models/ultravox.py b/vllm/model_executor/models/ultravox.py index e403060d24..a66bda3c1e 100644 --- a/vllm/model_executor/models/ultravox.py +++ b/vllm/model_executor/models/ultravox.py @@ -404,12 +404,14 @@ class UltravoxTransformerProjector(nn.Module, ModuleUtilsMixin): kwargs["layer_head_mask"] = None for layer in self.layers: - layer_outputs = layer( + hidden_states = layer( hidden_states, attention_mask=extended_attention_mask, **kwargs, ) - hidden_states = layer_outputs[0] + # BC version that allows for the old tupled output + if isinstance(hidden_states, tuple): + hidden_states = hidden_states[0] hidden_states = self.ln_post(hidden_states) hidden_states = self.linear_out(hidden_states) @@ -509,13 +511,14 @@ class ModifiedWhisperEncoder(WhisperEncoder): kwargs["layer_head_mask"] = None for encoder_layer in self.layers: - layer_outputs = encoder_layer( + hidden_states = encoder_layer( hidden_states, attention_mask, **kwargs, ) - - hidden_states = layer_outputs[0] + # BC version that allows for the old tupled output + if isinstance(hidden_states, tuple): + hidden_states = hidden_states[0] hidden_states = self.layer_norm(hidden_states) return hidden_states diff --git a/vllm/transformers_utils/configs/ultravox.py b/vllm/transformers_utils/configs/ultravox.py index 395b3130d4..31b49b9d99 100644 --- a/vllm/transformers_utils/configs/ultravox.py +++ b/vllm/transformers_utils/configs/ultravox.py @@ -43,7 +43,6 @@ class UltravoxConfig(transformers.PretrainedConfig): use `False`, but v0.5 and above use `True`. """ - wrapped_model_config: transformers.PretrainedConfig model_type = "ultravox" audio_token = "<|audio|>" is_composition = False @@ -75,6 +74,7 @@ class UltravoxConfig(transformers.PretrainedConfig): self.num_projector_layers = num_projector_layers # N.B. May set the wrapped_model_config below. + self.wrapped_model_config: transformers.PretrainedConfig self.text_model_id = text_model_id if text_model_id is None: text_config = text_config or {}