2025-09-11 14:32:51 +08:00
|
|
|
"""
|
2025-09-25 09:10:54 +08:00
|
|
|
Configuration module for vLLM-omni.
|
2025-09-11 14:32:51 +08:00
|
|
|
"""
|
2025-10-23 10:26:21 +08:00
|
|
|
|
2025-10-24 16:49:19 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
|
|
from pydantic import ConfigDict
|
|
|
|
|
from pydantic.dataclasses import dataclass
|
|
|
|
|
from vllm.config import ModelConfig, config
|
2025-10-22 14:37:55 +08:00
|
|
|
|
|
|
|
|
import vllm_omni.model_executor.models as me_models
|
2025-09-11 14:32:51 +08:00
|
|
|
|
2025-10-22 14:37:55 +08:00
|
|
|
|
|
|
|
|
@config
|
|
|
|
|
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
|
|
|
|
|
class OmniModelConfig(ModelConfig):
|
|
|
|
|
"""Configuration for Omni models, extending the base ModelConfig."""
|
2025-10-24 16:49:19 +08:00
|
|
|
|
2025-10-22 14:37:55 +08:00
|
|
|
stage_id: int = 0
|
|
|
|
|
model_stage: str = "thinker"
|
|
|
|
|
model_arch: str = "Qwen2_5OmniForConditionalGeneration"
|
|
|
|
|
engine_output_type: Optional[str] = None
|
2025-10-24 16:49:19 +08:00
|
|
|
|
2025-10-22 14:37:55 +08:00
|
|
|
@property
|
|
|
|
|
def registry(self):
|
|
|
|
|
return me_models.OmniModelRegistry
|
2025-10-24 16:49:19 +08:00
|
|
|
|
2025-10-22 14:37:55 +08:00
|
|
|
@property
|
|
|
|
|
def architectures(self) -> list[str]:
|
|
|
|
|
return [self.model_arch]
|
|
|
|
|
|
|
|
|
|
|
2025-09-25 09:10:54 +08:00
|
|
|
__all__ = [
|
2025-10-22 14:37:55 +08:00
|
|
|
"OmniModelConfig",
|
2025-10-24 12:16:48 +08:00
|
|
|
]
|