Skip to content

feat: support CosyVoice3 in webui.py#1888

Open
jasagiri wants to merge 2 commits into
FunAudioLLM:mainfrom
jasagiri:feat/webui-cosyvoice3
Open

feat: support CosyVoice3 in webui.py#1888
jasagiri wants to merge 2 commits into
FunAudioLLM:mainfrom
jasagiri:feat/webui-cosyvoice3

Conversation

@jasagiri
Copy link
Copy Markdown

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 and others added 2 commits May 18, 2026 04:14
CosyVoice3's LLM requires an <|endofprompt|> token in prompt_text
(zero-shot) or tts_text (cross-lingual). webui.py passed user input
straight through, so CosyVoice3 zero-shot / cross-lingual failed with
"AssertionError: <|endofprompt|> not detected".

Prepend the system prompt when the loaded model is a CosyVoice3
instance; the CosyVoice and CosyVoice2 paths are unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
torchaudio removed torchaudio.info in 2.11, so webui.py's prompt-wav
validation failed with AttributeError. Use soundfile.info instead,
consistent with the soundfile-based load_wav.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant