fix(stage-ui): cosyvoice SSML support - #576
Conversation
❌ Deploy Preview for airi-docs failed. Why did it fail? →
|
✅ Deploy Preview for airi-vtuber ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Summary of Changes
Hello @yanghui1-arch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request improves the accuracy of SSML (Speech Synthesis Markup Language) support detection within the stage-ui module. It specifically addresses an issue where Alibaba Cloud speech models were incorrectly assumed to universally support SSML. The changes ensure that only models like cosyvoice-v2 that genuinely offer SSML capabilities are flagged as such, while others are correctly identified as not supporting it.
Highlights
- SSML Support Refinement for Alibaba Cloud: The logic for determining SSML support has been refined for Alibaba Cloud speech models. Previously, all Alibaba Cloud models were implicitly considered to support SSML, which was incorrect for some.
- cosyvoice-v2 SSML Enablement: Explicit support for SSML has been added for the cosyvoice-v2 model under the alibaba-cloud-model-studio provider, ensuring it is correctly identified as SSML-capable.
- Corrected cosyvoice-v1 SSML Status: cosyvoice-v1 and other non-cosyvoice-v2 Alibaba models are now correctly identified as not supporting SSML, resolving a previous misclassification.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue where cosyvoice-v1 was incorrectly reported as supporting SSML. The change introduces a specific condition for Alibaba Cloud's models, ensuring cosyvoice-v1 is excluded from SSML support while enabling it for cosyvoice-v2. My feedback includes a suggestion to refactor the logic for better readability and maintainability by grouping the conditions related to the Alibaba provider.
| const supportsSSML = computed(() => { | ||
| // Currently only ElevenLabs and some other providers support SSML | ||
| return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'alibaba-cloud-model-studio', 'volcengine'].includes(activeSpeechProvider.value) | ||
| // only part voices are support SSML in cosyvoice-v2 which is provided by alibaba | ||
| if (activeSpeechProvider.value === 'alibaba-cloud-model-studio' && activeSpeechModel.value === 'cosyvoice-v2') { | ||
| return true | ||
| } | ||
| return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value) | ||
| }) |
There was a problem hiding this comment.
The logic is correct, but it could be restructured for better readability and maintainability. By handling the special case for the alibaba-cloud-model-studio provider first, you can make the logic for SSML support clearer. This also makes it easier to add more model-specific logic for this provider in the future.
| const supportsSSML = computed(() => { | |
| // Currently only ElevenLabs and some other providers support SSML | |
| return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'alibaba-cloud-model-studio', 'volcengine'].includes(activeSpeechProvider.value) | |
| // only part voices are support SSML in cosyvoice-v2 which is provided by alibaba | |
| if (activeSpeechProvider.value === 'alibaba-cloud-model-studio' && activeSpeechModel.value === 'cosyvoice-v2') { | |
| return true | |
| } | |
| return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value) | |
| }) | |
| const supportsSSML = computed(() => { | |
| // Currently only ElevenLabs and some other providers support SSML | |
| // only part voices are support SSML in cosyvoice-v2 which is provided by alibaba | |
| if (activeSpeechProvider.value === 'alibaba-cloud-model-studio') { | |
| return activeSpeechModel.value === 'cosyvoice-v2' | |
| } | |
| return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value) | |
| }) |
There was a problem hiding this comment.
I think it's not great because not every voice of cosyvoice-v2 supports SSML according to alibaba docs. The reason that I don't list these availiable voices is unspeech currently doesn't support cosyvoice-v2 voices. It just includes cosyvoice-v1 voice names. When unspeech supports we need to also judge whether voice of cosyvoice-v2 supports SSML.
There was a problem hiding this comment.
Feel free to open a issue for unspeech for me (or you) to support the cosyvoice-v2 later.
Description
This PR fix SSML support of cosyvoice-v1 return value is wrong.
Previous judgement about a speech model is supported SSML by provider. However cosyvoice-v1, a speech model which is provided by alibaba, is not supported SSML. So I add a special condition to solve it and not have influence on other provider models.
Linked Issues
#567
#570
Additional Context
About alibaba provider model SSML support docs
You can search
SSML标记语言支持说明unspeechpackage support cosyvoice-v2 models, we need to update code to verify whether the voice supported SSML because not every voice supports it.