[Core] Validate PipelineConfig in __post_init__ (#6829)
Signed-off-by: Alex Brooks <albrooks@redhat.com>
This commit is contained in:
1 parent
7992c2213e
commit
a65e89cbd4
8 files changed
+121
-84
No files matched your search
@@ -26,6 +26,7 @@ from vllm_omni.config.pipeline_registry import OMNI_PIPELINES
|
||||
from vllm_omni.config.stage_config import (
|
||||
PipelineConfig,
|
||||
StageExecutionType,
|
||||
StagePipelineConfig,
|
||||
_apply_platform_overrides,
|
||||
load_deploy_config,
|
||||
merge_pipeline_deploy,
|
||||
@@ -65,7 +66,9 @@ class TestRegistryDeclaration:
|
||||
assert not hasattr(pipeline, "max_native_duplex_sessions")
|
||||
|
||||
def test_ordinary_pipeline_defaults_to_no_duplex_control(self) -> None:
|
||||
pipeline = PipelineConfig(model_type="ordinary")
|
||||
pipeline = PipelineConfig(
|
||||
model_type="ordinary", stages=(StagePipelineConfig(stage_id=0, model_stage="a", final_output=True),)
|
||||
)
|
||||
assert pipeline.duplex_control_enabled is False
|
||||
assert pipeline.duplex_serving_adapter is None
|
||||
assert not hasattr(pipeline, "max_native_duplex_sessions")
|
||||
@@ -80,10 +83,6 @@ class TestPipelineTopology:
|
||||
assert len(pipeline.stages) == 3
|
||||
assert [s.stage_id for s in pipeline.stages] == [0, 1, 2]
|
||||
|
||||
def test_topology_validates(self, pipeline: PipelineConfig) -> None:
|
||||
# ``validate`` returns a list of structural errors; empty == valid.
|
||||
assert pipeline.validate() == []
|
||||
|
||||
def test_thinker_stage(self, pipeline: PipelineConfig) -> None:
|
||||
thinker = pipeline.get_stage(0)
|
||||
assert thinker is not None
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
"""L1 registration + config-shim tests for NemotronVoiceChat (CPU, no weights)."""
|
||||
|
||||
import subprocess
|
||||
@@ -59,7 +59,6 @@ def test_pipeline_registered_with_three_stages() -> None:
|
||||
assert code2wav.execution_type == StageExecutionType.LLM_GENERATION
|
||||
assert code2wav.final_output and code2wav.final_output_type == "audio"
|
||||
assert code2wav.input_sources == (1,)
|
||||
assert pipeline.validate() == []
|
||||
|
||||
|
||||
def test_architectures_registered() -> None:
|
||||
|
||||
Reference in new issue
Block a user