Convenient default behavior for pipeline TTS usage. - #42473
Conversation
| # Add speaker ID if needed and user didn't insert at start of text | ||
| if self.model.config.model_type == "csm": | ||
| text = [f"[0]{t}" if not t.startswith("[") else t for t in text] | ||
| if self.model.config.model_type == "dia": | ||
| text = [f"[S1] {t}" if not t.startswith("[") else t for t in text] |
There was a problem hiding this comment.
Hum really really not a fan of such hidden processing. This is where the abstraction of the pipeline (this does make sense if you want to interchange model id with simply changing the model) complicates things more than they simplify it ... but okay to keep here since there is already so much custom processing in the audio pipeline codes and that anyway.
Note we might remove in the future though if we find an good API to have specific kwargs for each TTS models and a convinient way to default them.
There was a problem hiding this comment.
Definitely, for example preset as we discussed here
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
What does this PR do?
Related to offline discussion with @eustlb and @Deep-unlearning, let's change default pipeline TTS behavior to make it easier to users.
I pinned
output_audio=Truefor CSM but also did manual insertion of speaker IDs (for CSM and Dia) to make usage more intuitive for simple TTS usage.See below some CSM and Dia examples.
@Deep-unlearning what do you think about adding such examples to the TTS page (while pruning the verbose comments).
At least the CSM voice cloning example (and pointing to this dataset so they know what the original voice sounds like).