Unverified Commit 2ff0ad96 authored by Anton Vlasjuk's avatar Anton Vlasjuk Committed by GitHub
Browse files

[`UltraVox`] Fix output type (#37224)


Signed-off-by: default avatarvasqu <antonprogamer@gmail.com>
Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent a836524d
......@@ -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
......
......@@ -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 {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment