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

作者 : admin 本文共712个字,预计阅读时间需要2分钟 发布时间: 2024-06-9 共2人阅读

ChatTTS部署

官方信息

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

搭建步骤

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

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

  • 3、下载模型
    git clone http://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’
    ChatTTS 文字生成语言本地模型部署插图
本站无任何商业行为
个人在线分享 » ChatTTS 文字生成语言本地模型部署
E-->