Index-TTS 1.5 文本转语音本地部署及常见报错解析

一、项目介绍

IndexTTS:工业级可控高效的零样本文本转语音系统

只需上传一段简短语音,即可轻松克隆音色!

IndexTTS 是一款基于 GPT 架构的文本转语音(TTS)模型,其核心整合了 XTTS 和 Tortoise 的技术优势。该系统具备强大的中文处理能力:能通过拼音精准校正汉字发音,并能利用标点符号灵活控制语句中任意位置的停顿节奏。

我们针对多个核心模块进行了深度优化:显著改进了说话人特征的表征能力,并集成了先进的 BigVGAN2 模型以大幅提升输出音质。依托于数万小时海量数据的训练,IndexTTS 在性能上达到了当前业内领先水平(State-of-the-Art),在综合表现上超越了包括 XTTS、CosyVoice2、Fish-Speech、F5-TTS 等在内的主流 TTS 系统。

2025/05/14 🔥🔥 We release the IndexTTS-1.5, Significantly improve the model’s stability and its performance in the English language.

2025/05/14🔥🔥我们释放IndexTTS-1.5,显着提高了模型的稳定性及其在英语中的性能。

2025/03/25 🔥 We release IndexTTS-1.0 model parameters and inference code.

2025/03/25🔥我们发布IndexTTS-1.0模型参数和推理代码。

2025/02/12 🔥 We submitted our paper on arXiv, and released our demos and test sets.

2025/02/12🔥我们提交了关于arXiv的论文,并发布了我们的演示和测试集

二、项目下载

本文部署环境为Linux远端服务器,配置为生产级3090

项目地址:https://github.com/index-tts/index-tts

从github上克隆Index-tts项目到本地:

git clone https://github.com/index-tts/index-tts.git

三、python环境配置

使用conda创建一个新的虚拟环境

conda create -n indextts python=3.12

conda env list

conda activate indextts

为什么选择使用conda来创建python环境,是因为Index-TTS需要使用一个pypi包——pynini 2.1.6

以及在之后安装WeTextProcessing是需要依赖pynini

conda activate indextts
# 当你激活新建的这个 indextts 环境后

# 安装 ffmpeg
conda install -c conda-forge ffmpeg

# 安装 pynini
conda install -c conda-forge pynini==2.1.6

# 安装 WeTextProcessing
pip install WeTextProcessing==1.0.2 --no-deps
#如果在安装WeTextProcessing遇到报错
ERROR: Could not find a version that satisfies the requirement importlib-resources (from wetextprocessing) (from versions: none)
ERROR: No matching distribution found for importlib-resources
是本机缺少importlib-resources 补充包
pip install importlib-resources
安装后检查安装
pip show WeTextProcessing

注意这里选的的是WeTextProcessing 1.0.2,使用其他的可能会报错

当然,如果你使用的是python312,又不想使用conda,那么这里有一个编译好的whl可以选择:

https://github.com/sunxfancy/pynini-2.1.6.post1/releases/tag/2.1.6.post1

这位大佬提供了pynini-2.1.6post1 和 WeTextProcessing-1.0.4,直接下载,安装即可

pip install pynini-2.1.6.post1-cp312-cp312-win_amd64.whl

pip install WeTextProcessing-1.0.4-py3-none-any.whl

安装troch、trochaudio

安装torch、torchaudio是需要根据电脑当前的 cuda 版本来确定的。

比如我这里,我是cuda121的,所以我选择的是cu121的

python -m pip install -U torch==2.5.1+cu121 torchaudio==2.5.1+cu121 --index-url https://download.pytorch.org/whl/cu128
安装其他依赖

其他依赖包的安装

cd index-tts

python -m pip install -r .\requirements.txt

安静等待下载、安装完成即可。

另外如果启动的时候,报错缺少某个包的话,可以使用

四、模型下载

IndexTTS v1.5下载(推荐)

使用huggingface-cli下载:https://huggingface.co/IndexTeam/IndexTTS-1.5

# 安装huggingface-hub
pip install huggingface_hub[cli]

# 打开项目文件夹
cd index-tts

# 使用 huggingface-cli 下载模型
huggingface-cli download --resume-download IndexTeam/IndexTTS-1.5 --local-dir ./checkpoints

# 你也可以使用国内镜像加速
$env:HF_ENDPOINT = "https://hf-mirror.com"

如果你的服务器属于内网服务器无法访问huggingfaze

使用modelscope下载:https://modelscope.cn/models/IndexTeam/IndexTTS-1.5

# 安装 modelscope 
pip install modelscope

# 打开项目文件夹
cd index-tts 

# 使用 modelscope 下载模型
modelscope download --model IndexTeam/IndexTTS-1.5 --local_dir ./checkpoints

也可使用可访问huggingfaze的设备下载至本地并上传至服务器,模型文件放到checkpoints文件夹下,详细可询问deepseek

五、项目启动

在上述的依赖安装模型下载完成之后,就可以着手启动项目了

打开项目,切换环境

cd index-tts

conda activate indextts

# 查看一下你的依赖项
pip list
启动项目
python webui.py

启动成功

# 启动成功后,会提示
Running on local URL:  http://127.0.0.1:7860

使用浏览器打开http://127.0.0.1:7860,即可访问项目了。

六、运行报错

一开始有如下错误

GPT weights restored from: checkpoints/gpt.pth
DeepSpeed加载失败,回退到标准推理: No module named 'deepspeed'
Failed to load custom CUDA kernel for BigVGAN. Falling back to torch.

安装deepspeed之后就好了:pip install deepspeed

执行之后卡在这个阶段过久无变化


webui.py
>> GPT weights restored from: checkpoints/gpt.pth
[2025-05-22 11:08:28,577] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-22 11:08:33,501] [INFO] [logging.py:107:log_dist] [Rank -1] DeepSpeed info: version=0.16.8, git-hash=unknown, git-branch=unknown
[2025-05-22 11:08:33,501] [WARNING] [config_utils.py:70:_process_deprecated_field] Config parameter mp_size is deprecated use tensor_parallel.tp_size instead
[2025-05-22 11:08:33,501] [INFO] [logging.py:107:log_dist] [Rank -1] quantize_bits = 8 mlp_extra_grouping = False, quantize_groups = 1

需要手动 ctrl +c 取消,才能回退 torch

run webui.py
>> GPT weights restored from: checkpoints/gpt.pth
[2025-05-22 11:08:28,577] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-22 11:08:33,501] [INFO] [logging.py:107:log_dist] [Rank -1] DeepSpeed info: version=0.16.8, git-hash=unknown, git-branch=unknown
[2025-05-22 11:08:33,501] [WARNING] [config_utils.py:70:_process_deprecated_field] Config parameter mp_size is deprecated use tensor_parallel.tp_size instead
[2025-05-22 11:08:33,501] [INFO] [logging.py:107:log_dist] [Rank -1] quantize_bits = 8 mlp_extra_grouping = False, quantize_groups = 1
^C>> Failed to load custom CUDA kernel for BigVGAN. Falling back to torch.
Removing weight norm...
>> bigvgan weights restored from: checkpoints/bigvgan_generator.pth
2025-05-22 11:09:38,518 WETEXT INFO found existing fst: /mnt/data/workspace/ai/tts/index-tts/indextts/utils/tagger_cache/zh_tn_tagger.fst
2025-05-22 11:09:38,518 WETEXT INFO                     /mnt/data/workspace/ai/tts/index-tts/indextts/utils/tagger_cache/zh_tn_verbalizer.fst
2025-05-22 11:09:38,518 WETEXT INFO skip building fst for zh_normalizer ...
2025-05-22 11:09:38,756 WETEXT INFO found existing fst: /mnt/data/workspace/ai/tts/index-tts/.venv/lib/python3.10/site-packages/tn/en_tn_tagger.fst
2025-05-22 11:09:38,757 WETEXT INFO                     /mnt/data/workspace/ai/tts/index-tts/.venv/lib/python3.10/site-packages/tn/en_tn_verbalizer.fst
2025-05-22 11:09:38,757 WETEXT INFO skip building fst for en_normalizer ...
>> TextNormalizer loaded
>> bpe model loaded from: checkpoints/bpe.model
* Running on local URL:  http://127.0.0.1:7860
* To create a public link, set `share=True` in `launch()`.

确认 PyTorch 与你的 CUDA 驱动版本兼容

确认 cuda 工具链正确安装

需要配置与cuda 工具版本兼容的编译器,并确保在index-tts 运行环境中能加载到

Linux 用户则需要确认当前环境中的 gcc 是否与nvcc兼容,可以使用conda 安装 gcc 兼容版本

七、生成语音

相信你以及完成部署并成功运行

上传你需要克隆的音色文件,必须清晰,不带杂音

输出的文件在:index-tts/outputs

官方demo链接

IndexTTS: An Industrial-Level Controllable and Efficient Zero-Shot Text-To-Speech System

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值