Enhance your text generation experience with the Kokoro TTS extension, seamlessly integrating with the Oobabooga Text Generation WebUI.
License
Features
Current Version: Kokoro v1
Supported Languages: English
Kokoro TTS is limited to inputs up to 510 tokens. Note that Kokoro tokens differ from LLM tokens. This extension allows you to generate longer audio outputs by splitting the input text into segments and concatenating the resulting audio.
Audio Play
Currently, the Audio Play feature is not available in the main branch as it is still in development, but you can see here how to use it.
Unique TTS voices are assigned to each speaker in dialogue to get a audio play like experience.
Text Splitting Methods
- Split by Sentence: Divides the text into chunks of complete sentences, each chunk containing fewer than or 510 tokens.
- This method may fail to split the text into sentences if the input text contains unusual punctuation or formatting. In such cases, the extension will fall back to the “Split by Word” method for this one text.
- Split by Word: Divides the text into chunks of individual words, each chunk containing fewer than or 510 tokens.
I recommend using the “Split by Sentence” method to maintain context and ensure higher quality audio output.
Installation
Prerequisites
Before installing the extension, ensure you have the following dependencies installed:
Python Dependencies
Install the required Python packages using the appropriate script for your operating system.
Windows
- Run the Windows setup script:
.\cmd_windows.bat
- Install the Python dependencies:
pip install -r extensions\KokoroTtsTextGenerationWebUI\requirements.txt
Linux
- Run the Linux setup script:
./cmd_linux.sh
- Install the Python dependencies:
pip install -r extensions/KokoroTtsTextGenerationWebUI/requirements.txt
Multiple GPU Support
By default, the extension utilizes the first available GPU. To specify a different GPU, modify the device variable in src/generate.py to your desired GPU identifier.
Roadmap
Contributing
I welcome contributions to improve this project! If you’d like to contribute, please create a pull request or open an issue. Your improvements and suggestions are highly appreciated.
评论