[Ultravox] Use wrapped_model_config to instantiate inner model (#24679)

Signed-off-by: Peter Salas <peter@fixie.ai>
This commit is contained in:
Peter Salas
2025-09-11 18:52:24 +00:00
committed by GitHub
parent bb2b5126da
commit 127ded0a9e
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -46,7 +46,7 @@ class UltravoxConfig(transformers.PretrainedConfig):
projector or at the end. Versions v0.4.1 and below
use `False`, but v0.5 and above use `True`.
"""
wrapped_model_config: transformers.PretrainedConfig
model_type = "ultravox"
audio_token = "<|audio|>"
is_composition = False
@@ -113,9 +113,8 @@ class UltravoxConfig(transformers.PretrainedConfig):
return super().__setattr__(key, value)
@property
def text_config(self) -> Optional[transformers.PretrainedConfig]:
def text_config(self) -> transformers.PretrainedConfig:
# When Ultravox wraps a multi-modal model (e.g. Gemma), we instantiate
# the full model, but the text config is the text config of the inner
# model.
return (self.wrapped_model_config.get_text_config()
if self.wrapped_model_config else None)
return self.wrapped_model_config.get_text_config()