Australia/Sydney
BlogJune 5, 2024

ChatTTS Text to Speech Model Installation Locally

Fahd Mirza

 This video shows a step-by-step process to locally install ChatTTS which is a text-to-speech model designed specifically for dialogue scenario such as LLM assistant. It supports both English and Chinese languages.



Code:

conda create -n chattts python=3.11 -y

git clone https://github.com/2noise/ChatTTS.git

cd ChatTTS

pip install -r requirements.txt
pip install gradio
pip install pynini
pip install nemo_text_processing
pip install WeTextProcessing
pip install torchaudio


import torch
torch._dynamo.config.cache_size_limit = 64
torch._dynamo.config.suppress_errors = True
torch.set_float32_matmul_precision('high')
import torchaudio
import ChatTTS
from IPython.display import Audio
import warnings
warnings.filterwarnings('ignore')

texts = ["hello, this is Fahd , and AI Youtuber. hahahaha. Subscribe to the channel please and also share it among your network",]

chat = ChatTTS.Chat()
chat.load_models()
       
wavs = chat.infer(texts)

torchaudio.save("/home/Ubuntu/audiooutput/myaudio1.wav", torch.from_numpy(wavs[0]), 24000)
Share this post:
On this page

Let's Partner

If you are looking to build, deploy or scale AI solutions — whether you're just starting or facing production-scale challenges — let's chat.

Subscribe to Fahd's Newsletter

Weekly updates on AI, cloud engineering, and tech innovations