erew123 / alltalk_tts

AllTalk is based on the Coqui TTS engine, similar to the Coqui_tts extension for Text generation webUI, however supports a variety of advanced features, such as a settings page, low VRAM support, DeepSpeed, narrator, model finetuning, custom models, wav file maintenance. It can also be used with 3rd Party software via JSON calls.
GNU Affero General Public License v3.0
864 stars 98 forks source link

Token Limit en 250 #325

Closed maglore9900 closed 2 weeks ago

maglore9900 commented 2 weeks ago

Describe the bug There is a limitation on english characters at 250. What can I modify to change this max value?

To Reproduce Pass a text of more than 250 characters

Screenshots image

Text/logs If applicable, copy/paste in your logs here from the console.

Desktop (please complete the following information): AllTalk was updated: running the start bat, so it updates as necessary Custom Python environment: python 3.10 Text-generation-webUI was updated: today it verified it was up to date

erew123 commented 2 weeks ago

Hi @maglore9900

The 250 character limit is per sentence, not per entire block of text. The 250 character limit (as it mentions) is a warning, not a refusal to generate TTS. The message is generated by Coqui's tokenizer, not AllTalk.

There are articles on Coqui's forum discussing this in various ways:

https://github.com/coqui-ai/TTS/discussions?discussions_q=250+character

In short, individual sentences that are over 250 characters, that cannot be split down further, may cause the AI model to start hallucinating and the quality of the audio for that individual sentence degrades, over/above the 250 characters for that individual sentence, hence the warning message.

AllTalk does enable Coqui's sentence splitting, which it will do where possible https://github.com/erew123/alltalk_tts/blob/alltalkbeta/system/tts_engines/xtts/model_engine.py#L501 This line is telling Coqui's scripts to split where possible, using the method Coqui have implemented https://github.com/coqui-ai/TTS/blob/dev/TTS/tts/layers/xtts/tokenizer.py#L35.

If you wanted to change the warning message or other such settings, you would have to re-code the Coqui tokeniser in the TTS folder of the alltalk Python environment https://github.com/coqui-ai/TTS/blob/dev/TTS/tts/layers/xtts/tokenizer.py#L622 stored in \alltalk_tts\alltalk_environment\env\Lib\site-packages\TTS\tts\layers\xtts

Thanks

maglore9900 commented 2 weeks ago

Thank you. Love your product and I didnt expect to get a response to fast. Really appreciate the work you are putting into this.