@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 127ded0a9e
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

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

Signed-off-by: Peter Salas <peter@fixie.ai>

Peter Salas committed Sep 11, 2025 at 11:52 UTC 127ded0a9e3dce17fdcff6a105900439c076b9ba
2 files changed +5 -6
vllm/model_executor/models/ultravox.py
+2 -2
@@ -418,7 +418,7 @@ class UltravoxModel(nn.Module, SupportsMultiModal, SupportsPP, SupportsLoRA):
418
419 def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
420 super().__init__()
421 - config = vllm_config.model_config.hf_config
421 + config: UltravoxConfig = vllm_config.model_config.hf_config
422 multimodal_config = vllm_config.model_config.multimodal_config
423 self.config = config
424 self.multi_modal_config = multimodal_config
@@ -438,7 +438,7 @@ class UltravoxModel(nn.Module, SupportsMultiModal, SupportsPP, SupportsLoRA):
438 self.multi_modal_projector = UltravoxProjector(config)
439 self.language_model = init_vllm_registered_model(
440 vllm_config=vllm_config,
441 - hf_config=config.text_config,
441 + hf_config=config.wrapped_model_config,
442 prefix=maybe_prefix(prefix, "language_model"),
443 )
444 if config.text_model_id is not None:
vllm/transformers_utils/configs/ultravox.py
+3 -4
@@ -46,7 +46,7 @@ class UltravoxConfig(transformers.PretrainedConfig):
46 projector or at the end. Versions v0.4.1 and below
47 use `False`, but v0.5 and above use `True`.
48 """
49 -
49 + wrapped_model_config: transformers.PretrainedConfig
50 model_type = "ultravox"
51 audio_token = "<|audio|>"
52 is_composition = False
@@ -113,9 +113,8 @@ class UltravoxConfig(transformers.PretrainedConfig):
113 return super().__setattr__(key, value)
114
115 @property
116 - def text_config(self) -> Optional[transformers.PretrainedConfig]:
116 + def text_config(self) -> transformers.PretrainedConfig:
117 # When Ultravox wraps a multi-modal model (e.g. Gemma), we instantiate
118 # the full model, but the text config is the text config of the inner
119 # model.
120 - return (self.wrapped_model_config.get_text_config()
121 - if self.wrapped_model_config else None)
120 + return self.wrapped_model_config.get_text_config()