-
Notifications
You must be signed in to change notification settings - Fork 3.1k
sarvam v3:stt and tts models #4603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
6f83e4a
d74ce83
6fec239
db17cc3
cb128a3
77c6622
727e25d
10032db
d0fbb4e
388c982
e8716de
98b0206
c503a5c
e779b51
ca51fea
23b9f53
7fc5255
afbad7f
ff1bbc3
c55f8bc
f1252f1
64cca1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
devin-ai-integration[bot] marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ | |
| SARVAM_TTS_WS_URL = "wss://api.sarvam.ai/text-to-speech/ws" | ||
|
|
||
| # Sarvam TTS specific models and speakers | ||
| SarvamTTSModels = Literal["bulbul:v2"] | ||
| SarvamTTSModels = Literal["bulbul:v2", "bulbul:v3-beta"] | ||
|
|
||
| # Supported languages in BCP-47 format | ||
| SarvamTTSLanguages = Literal[ | ||
|
|
@@ -74,6 +74,34 @@ | |
| "abhilash", | ||
| "karun", | ||
| "hitesh", | ||
| # bulbul:v3-beta Customer Care | ||
| "shubh", | ||
| "ritu", | ||
| "rahul", | ||
| "pooja", | ||
| "simran", | ||
| "kavya", | ||
| "amit", | ||
| "ratan", | ||
| "rohan", | ||
| "dev", | ||
| "ishita", | ||
| "shreya", | ||
| "manan", | ||
| "sumit", | ||
| "priya", | ||
| # bulbul:v3-beta Content Creation | ||
| "aditya", | ||
| "kabir", | ||
| "neha", | ||
| "varun", | ||
| "roopa", | ||
| "aayan", | ||
| "ashutosh", | ||
| "advait", | ||
| # bulbul:v3-beta International | ||
| "amelia", | ||
| "sophia", | ||
| ] | ||
|
|
||
| # Model-Speaker compatibility mapping | ||
|
|
@@ -82,7 +110,65 @@ | |
| "female": ["anushka", "manisha", "vidya", "arya"], | ||
| "male": ["abhilash", "karun", "hitesh"], | ||
| "all": ["anushka", "manisha", "vidya", "arya", "abhilash", "karun", "hitesh"], | ||
| } | ||
| }, | ||
| "bulbul:v3-beta": { | ||
| "female": [ | ||
| "ritu", | ||
| "pooja", | ||
| "simran", | ||
| "kavya", | ||
| "ishita", | ||
| "shreya", | ||
| "priya", | ||
| "neha", | ||
| "roopa", | ||
| "amelia", | ||
| "sophia", | ||
| ], | ||
| "male": [ | ||
| "shubh", | ||
| "rahul", | ||
| "amit", | ||
| "ratan", | ||
| "rohan", | ||
| "dev", | ||
| "manan", | ||
| "sumit", | ||
| "aditya", | ||
| "kabir", | ||
| "varun", | ||
| "aayan", | ||
| "ashutosh", | ||
| "advait", | ||
| ], | ||
| "all": [ | ||
| "shubh", | ||
| "ritu", | ||
| "rahul", | ||
| "pooja", | ||
| "simran", | ||
| "kavya", | ||
| "amit", | ||
| "ratan", | ||
| "rohan", | ||
| "dev", | ||
| "ishita", | ||
| "shreya", | ||
| "manan", | ||
| "sumit", | ||
| "priya", | ||
| "aditya", | ||
| "kabir", | ||
| "neha", | ||
| "varun", | ||
| "roopa", | ||
| "aayan", | ||
| "ashutosh", | ||
| "advait", | ||
| "amelia", | ||
| "sophia", | ||
| ], | ||
| }, | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -313,7 +399,7 @@ def update_options( | |
| if model is not None: | ||
| if not model.strip(): | ||
| raise ValueError("Model cannot be empty") | ||
| if model not in ["bulbul:v2"]: | ||
| if model not in ["bulbul:v2", "bulbul:v3-beta"]: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't a great pattern, because when you introduce new models, the plugin cannot be used without an update. we recommend not hard blocking model lists in the plugin, your server should be the authority here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair, I'll remove this check |
||
| raise ValueError(f"Unsupported model: {model}") | ||
| self._opts.model = model | ||
|
Comment on lines
461
to
464
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 TTS When Click to expandHow the bug is triggeredIn if model is not None:
if not model.strip():
raise ValueError("Model cannot be empty")
self._opts.model = model # Speaker compatibility not checked!The ImpactIf a TTS instance is created with Recommendation: After updating the model, validate that the current speaker is compatible with the new model. If not, either raise an error or reset to a default speaker for the new model. Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
|
Comment on lines
461
to
478
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revalidate the existing speaker when switching models. 🐛 Proposed fix if model is not None:
if not model.strip():
raise ValueError("Model cannot be empty")
if model not in ["bulbul:v2", "bulbul:v3-beta"]:
raise ValueError(f"Unsupported model: {model}")
self._opts.model = model
+ if speaker is None and not validate_model_speaker_compatibility(
+ model, self._opts.speaker
+ ):
+ compatible = MODEL_SPEAKER_COMPATIBILITY.get(model, {}).get("all", [])
+ raise ValueError(
+ f"Speaker '{self._opts.speaker}' is not compatible with model '{model}'. "
+ "Please choose a compatible speaker from: "
+ f"{', '.join(compatible)}"
+ )🤖 Prompt for AI Agents |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.