HuggingFace镜像/ChatTTS
模型介绍文件和版本分析
下载使用量0

我们也在训练更大规模的模型,需要计算资源和数据支持。如果您能提供帮助,请联系 OPEN-SOURCE@2NOISE.COM。非常感谢。

克隆仓库

首先,克隆 Git 仓库:

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

模型推理

# Import necessary libraries and configure settings
import torch
import torchaudio
torch._dynamo.config.cache_size_limit = 64
torch._dynamo.config.suppress_errors = True
torch.set_float32_matmul_precision('high')

import ChatTTS
from IPython.display import Audio

# Initialize and load the model: 
chat = ChatTTS.Chat()
chat.load_models(compile=False) # Set to True for better performance

# Define the text input for inference (Support Batching)
texts = [
    "So we found being competitive and collaborative was a huge way of staying motivated towards our goals, so one person to call when you fall off, one person who gets you back on then one person to actually do the activity with.",
    ]

# Perform inference and play the generated audio
wavs = chat.infer(texts)
Audio(wavs[0], rate=24_000, autoplay=True)

# Save the generated audio 
torchaudio.save("output.wav", torch.from_numpy(wavs[0]), 24000)

更多使用示例,请参考示例笔记本,其中包含用于更精细控制生成语音的参数,例如指定说话人、调整语速和添加笑声。

免责声明:仅供学术用途

本文档中提供的信息仅供学术用途。其旨在用于教育和研究,不得用于任何商业或法律目的。作者不对信息的准确性、完整性或可靠性做出保证。