CosyVoice icon indicating copy to clipboard operation
CosyVoice copied to clipboard

feat: support CosyVoice3 in webui.py

Open jasagiri opened this issue 6 months ago • 0 comments

Summary

webui.py predates CosyVoice2/3 and does not work with CosyVoice3:

  • zero-shot / cross-lingual pass prompt_text / tts_text straight through, but CosyVoice3's LLM requires an <|endofprompt|> token — generation fails with "AssertionError: <|endofprompt|> not detected".
  • the prompt-wav sample-rate check uses torchaudio.info, removed in torchaudio 2.11.

This prepends the system prompt for CosyVoice3 models (CosyVoice / CosyVoice2 paths unchanged) and switches the sample-rate check to soundfile.info.

The instruct path still uses the CosyVoice-1.0-only inference_instruct; migrating it to inference_instruct2 needs UI changes and is left out of scope.

Test plan

  • [ ] webui zero-shot with a CosyVoice3 model generates audio (stream on/off)

jasagiri avatar May 18 '26 05:05 jasagiri