[大模型]ChatTTS Windows安装(CPU)

简介

ChatTTS是专为对话场景设计的语音生成模型,配合生成式大大语言模型,现在人人都可以拥有一个自己的贾维斯。
本文主要运行在windows环境下,目前只能cpu运行
cuda在windows上运行暂时会报错(截止2024-6-16),目前博主暂无解决方式,将后期补充

ImportError: cannot import name 'hf_hub_download' from 'huggingface_hub'

项目下载

项目地址
https://github.com/2noise/ChatTTS/tree/main
中文文档
https://github.com/2noise/ChatTTS/blob/main/README_CN.md
模型文件下载
https://www.modelscope.cn/models/henjicc/ChatTTS/files
ChatTTS中文官网
https://chattts.com/zh
Hugging Face模型地址
https://huggingface.co/2Noise/ChatTTS

创建环境

conda create --name chattts python=3.10

切换chattts坏境

conda activate chattts

安装相关依赖

安装环境(cpu)

安装requirements.txt

pip install -r requirements.txt

Windos下运行需要修改core.py中的76行。
否则会报错Windows not yet supported for torch.compile
在这里插入图片描述

安装gradio,否则将会提示No module named ‘gradio’
image.png

# 安装gradio
pip install gradio

修改core.py中的134行,否则会提示
cannot access local variable ‘Normalizer’ where it is not associated with a value

do_text_normalization=False

image.png
image.png

安装环境(cuda)目前无法使用

cuda环境可在linux下尝试运行
安装requirements.txt

pip install -r requirements.txt

安装cuda

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

配置使用本地模型文件

修改core.py中的50行。
image.png
image.png

启动项目

命令行

python .\webui.py

image.png
浏览器打开一下网址

http://localhost:8080/

生成示例

image.png
生成时,命令行输出如下
image.png
取消掉Refine text的勾选。
Output Text中就不在**[uv_brea]**的内容了
image.png

api调用

image.png
image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柒杉丶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值