From 968f3e379c292d395e600dfe5dfbb1e21f905d90 Mon Sep 17 00:00:00 2001 From: xutianle <24210290017@m.fudan.edu.cn> Date: Wed, 9 Sep 2026 11:33:38 +0800 Subject: [PATCH] [Bugfix][CosyVoice3] Resolve hash snapshot pipeline (#6896) Signed-off-by: xutianle --- tests/config/test_config_factory.py | 38 +++++++++++++++++++++++++++++ vllm_omni/deploy/cosyvoice3.yaml | 1 + 2 files changed, 39 insertions(+) diff --git a/tests/config/test_config_factory.py b/tests/config/test_config_factory.py index 6cb328bc5..51c7d549e 100644 --- a/tests/config/test_config_factory.py +++ b/tests/config/test_config_factory.py @@ -932,6 +932,44 @@ class TestPipelineRegistration: assert isinstance(omni_config, VllmOmniConfig) assert omni_config.stage_by_id(0).diffusion_config.model == "fake/model" + def test_cosyvoice3_deploy_resolves_hash_snapshot_without_hf_metadata(self, tmp_path): + snapshot = tmp_path / "models--FunAudioLLM--Fun-CosyVoice3-0.5B-2512" / "snapshots" / ("a" * 40) + snapshot.mkdir(parents=True) + (snapshot / "config.json").write_text("{}\n", encoding="utf-8") + model = str(snapshot) + deploy_path = get_deploy_config_path("cosyvoice3.yaml") + + assert StageConfigFactory.try_infer_model_type(model, trust_remote_code=False) is None + assert StageConfigFactory.get_pipeline_config(model, trust_remote_code=False) is None + + omni_config = StageConfigFactory.create_from_model( + model, + trust_remote_code=False, + cli_overrides={}, + deploy_config_path=deploy_path, + ) + legacy_configs, _ = StageConfigFactory.create_legacy_stage_configs_from_model( + model, + trust_remote_code=False, + cli_overrides={}, + deploy_config_path=deploy_path, + ) + + assert omni_config is not None + assert omni_config.pipeline_config.model_type == "cosyvoice3" + assert [ + (stage.stage_id, stage.stage_type, stage.worker_type, stage.model_stage) + for stage in omni_config.stage_configs + ] == [ + (0, StageType.LLM, "ar", "cosyvoice3_talker"), + (1, StageType.LLM, "generation", "cosyvoice3_code2wav"), + ] + assert all(stage.model_config.model == model for stage in omni_config.stage_configs) + assert all(stage.stage_type is not StageType.DIFFUSION for stage in omni_config.stage_configs) + + assert legacy_configs is not None + assert [stage.stage_type for stage in legacy_configs] == [StageType.LLM, StageType.LLM] + def test_pipeline_registration(self, clean_pipeline_registry): """Ensure that we can register and create a custom pipeline config.""" new_model_type = "new_model_type" diff --git a/vllm_omni/deploy/cosyvoice3.yaml b/vllm_omni/deploy/cosyvoice3.yaml index 551b42af6..09fd83290 100644 --- a/vllm_omni/deploy/cosyvoice3.yaml +++ b/vllm_omni/deploy/cosyvoice3.yaml @@ -23,6 +23,7 @@ # On a slower GPU class, lower max_num_seqs (e.g. 4) and/or codec_chunk_frames # first. Raising connector_get_sleep_s also relaxes the consumer's polling # cadence, but trades against TTFP — keep it as a last resort. +pipeline: cosyvoice3 async_chunk: true connectors: connector_of_shared_memory: