Alternative ways to use Kokoro-TTS kokoro-onnx, Kokoro-FastAPI, kokoro
- At least Python 3.10
- Git
- (Optional) Virtual Environment for dependency isolation
-
Clone the Repository
https://github.com/NeuralFalconYT/Kokoro-TTS-Subtitle.git cd Kokoro-TTS-Subtitle
-
(Optional) Create and Activate a Virtual Environment
- Windows:
python -m venv myenv myenv\Scripts\activate
- Mac/Linux:
python3 -m venv myenv source myenv/bin/activate
- Windows:
-
Install PyTorch
- Forcefully install Torch with CUDA. If you did not, then requirements.txt will install the CPU version [It's happening with my system.]
-
Check CUDA Version (for GPU setup):
nvcc --version
Find your CUDA version example
11.8
-
Visit PyTorch Get Started and install the version compatible with your CUDA setup.:
- For CUDA 11.8:
pip install torch --index-url https://download.pytorch.org/whl/cu118
- For CUDA 12.1:
pip install torch --index-url https://download.pytorch.org/whl/cu121
- For CUDA 12.4:
pip install torch --index-url https://download.pytorch.org/whl/cu124
-
- Install Dependencies
- Windows/Mac/Linux:
pip install -r requirements.txt
- Windows/Mac/Linux:
- Install eSpeak NG
-
For Windows:
- Download the eSpeak NG 1.50 release from the eSpeak NG GitHub Releases. [Or, You can try eSpeak NG latest Version]
- Locate and download the file named
espeak-ng-X64.msi
. - Run the installer and follow the installation steps. Ensure that you install eSpeak NG in the default directory:
C:\Program Files\eSpeak NG
Note: This default path is required for the application to locate eSpeak NG properly.
-
For Linux:
- Open your terminal.
- Install eSpeak NG using the following command:
sudo apt-get -qq -y install espeak-ng > /dev/null 2>&1
Note: This command suppresses unnecessary output for a cleaner installation process.
- Run the Application
If you used a virtual environment, make sure you enabled it.- Windows/Mac/Linux:
python beta.py
Then, double-click onpython one_clicker.py
run_app.bat
(Windows) to execute the script. - Windows/Mac/Linux:
- Use Kokoko TTS Gradio app as an API in your other project:
Check outscripts/api.py
Code
- Simply delete the
kokoro_v1
folder from your project directory.
- Inside the
kokoro_v1
directory, run the following command to uninstall dependencies:pip uninstall -r requirements.txt
- Uninstall PyTorch:
pip uninstall torch
- Navigate to
C:\Users\<username>\.cache\huggingface\hub
- Delete the contents of the
hub
folder. That's it! You've successfully removed everything.
If you encounter an error while generating Japanese audio, try the following steps:
-
Uninstall existing
unidic
:pip uninstall unidic -y
-
Reinstall
unidic
:pip install unidic
-
Download the dictionary data:
python -m unidic download
Note: This solution is likely to work, the same issue has been observed on both Colab and Hugging Face.
Kokoro model is licensed under the [Apache License 2.0]