Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vllm/model_executor/models/ultravox.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def get_placeholder_str(cls, modality: str, i: int) -> Optional[str]:

def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
super().__init__()
config = vllm_config.model_config.hf_config
config: UltravoxConfig = vllm_config.model_config.hf_config
multimodal_config = vllm_config.model_config.multimodal_config
self.config = config
self.multi_modal_config = multimodal_config
Expand All @@ -438,7 +438,7 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
self.multi_modal_projector = UltravoxProjector(config)
self.language_model = init_vllm_registered_model(
vllm_config=vllm_config,
hf_config=config.text_config,
hf_config=config.wrapped_model_config,
prefix=maybe_prefix(prefix, "language_model"),
)
if config.text_model_id is not None:
Expand Down
7 changes: 3 additions & 4 deletions vllm/transformers_utils/configs/ultravox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,9 +113,8 @@ def __setattr__(self, key, value):
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()