Bootstrap

ChatTTS 文字生成语言本地模型部署

ChatTTS部署

官方信息

[ChatTTS首页](https://chattts.com/)

搭建步骤

  • 1、下载源码
    git clone https://github.com/2noise/ChatTTS.git

  • 2、按照环境
    pip install torch ChatTTS
    pip install -r requirements.txt

  • 3、下载模型
    git clone https://www.modelscope.cn/pzc163/chatTTS.git

  • 4、执行测试代码

import torch
import ChatTTS
from IPython.display import Audio

# Initialize ChatTTS
chat = ChatTTS.Chat()
#./chatTTS为本地模型路径
chat.load_models('local', False, './chatTTS')

# Define the text to be converted to speech
texts = ["Hello, welcome to ChatTTS!",]

# Generate speech
wavs = chat.infer(texts, use_decoder=True)


# Play the generated audio
Audio(wavs[0], rate=24_000, autoplay=True)

如果报错未定义的Normalizer,可以执行一下指令
pip install WeTextProcessing && pip install nemo_text_processing

  • 5、运行webui.py 脚本
    pip install gradio
    python3 ./webui.py --local_path=‘./chatTTS’
    在这里插入图片描述
;