[Bugfix] Fix Qwen3-TTS word timestamps with async chunking (#7544)
Signed-off-by: bezdarnost <amanurumbekov@gmail.com>
This commit is contained in:
18 files changed
+459
-13
No files matched your search
@@ -1,3 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
import pytest
|
||||
|
||||
import vllm_omni.config.pipeline_registry # noqa: F401 (populate registry)
|
||||
@@ -69,3 +72,25 @@ def test_inject_noop_without_forced_aligner():
|
||||
|
||||
assert ext_pipeline is pipeline
|
||||
assert len(ext_deploy.stages) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("async_chunk", [True, False])
|
||||
@pytest.mark.parametrize("cli_async_chunk", [None, True, False])
|
||||
def test_aligner_uses_completed_audio_without_disabling_upstream_chunks(async_chunk, cli_async_chunk):
|
||||
from vllm_omni.config.config_factory import StageConfigFactory
|
||||
|
||||
pipeline = _PIPELINE_REGISTRY["qwen3_tts"]
|
||||
deploy = DeployConfig(async_chunk=async_chunk)
|
||||
resolution = StageConfigFactory._resolve_legacy_from_registry(
|
||||
pipeline,
|
||||
{"forced_aligner": "/models/Qwen3-ForcedAligner-0.6B", "async_chunk": cli_async_chunk},
|
||||
user_deploy_config=deploy,
|
||||
)
|
||||
stages = [stage.to_omegaconf() for stage in resolution.stage_configs]
|
||||
expected_async = async_chunk if cli_async_chunk is None else cli_async_chunk
|
||||
assert len(stages) == 3
|
||||
assert [stage.engine_args.async_chunk for stage in stages] == [expected_async, expected_async, False]
|
||||
assert stages[2].custom_process_input_func.endswith("code2wav2aligner")
|
||||
assert stages[2].engine_args.runner == "pooling"
|
||||
assert len(pipeline.stages) == 2
|
||||
assert deploy.stages == []
|
||||
@@ -1705,3 +1705,37 @@ def test_compact_offload_config_is_validated_during_projection():
|
||||
"components": ["dit"],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("pipeline_async", [True, False])
|
||||
@pytest.mark.parametrize("stage_async", [None, False, True])
|
||||
def test_stage_async_chunk_opt_out_matches_legacy_config(pipeline_async, stage_async):
|
||||
pipeline = _resolve_pipeline_or_skip("qwen3_tts")
|
||||
deploy = DeployConfig(
|
||||
async_chunk=pipeline_async,
|
||||
stages=[StageDeployConfig(stage_id=i, async_chunk=stage_async) for i in (0, 1)],
|
||||
)
|
||||
config = VllmOmniConfig.from_pipeline_config(pipeline, user_deploy_config=deploy)
|
||||
legacy = merge_pipeline_deploy(pipeline, deploy)
|
||||
expected = pipeline_async and stage_async is not False
|
||||
assert config.stage_by_id(0).connector_config.async_chunk is expected
|
||||
assert config.stage_by_id(1).connector_config.async_chunk is expected
|
||||
assert legacy[1].yaml_engine_args["async_chunk"] is expected
|
||||
assert config.stage_by_id(1).custom_process_input_func == legacy[1].custom_process_input_func
|
||||
if not expected:
|
||||
assert config.stage_by_id(1).custom_process_input_func.endswith("talker2code2wav_token_only")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("disabled_stage", [0, 1])
|
||||
@pytest.mark.parametrize("builder", [merge_pipeline_deploy, VllmOmniConfig.from_pipeline_config])
|
||||
def test_async_chunk_rejects_mismatched_connector_edge(disabled_stage, builder):
|
||||
pipeline = _resolve_pipeline_or_skip("qwen3_tts")
|
||||
deploy = DeployConfig(
|
||||
async_chunk=True,
|
||||
stages=[StageDeployConfig(stage_id=disabled_stage, async_chunk=False)],
|
||||
)
|
||||
with pytest.raises(ValueError, match="incompatible async_chunk settings on connector edge 0 -> 1"):
|
||||
if builder is merge_pipeline_deploy:
|
||||
builder(pipeline, deploy)
|
||||
else:
|
||||
builder(pipeline, user_deploy_config=deploy)
|
||||
Reference in new issue
Block a user