language:
- 英文
- 中文
license: apache-2.0
pipeline_tag: 文本转语音
模型描述
这是MegaTTS 3的HuggingFace模型卡片 👋
安装
git clone https://github.com/bytedance/MegaTTS3
cd MegaTTS3
模型下载
huggingface-cli download ByteDance/MegaTTS3 --local-dir ./checkpoints --local-dir-use-symlinks False
依赖安装(Linux系统)
conda create -n megatts3-env python=3.10
conda activate megatts3-env
pip install -r requirements.txt
export PYTHONPATH="/path/to/MegaTTS3:$PYTHONPATH"
export CUDA_VISIBLE_DEVICES=0
依赖安装(Windows系统)
conda create -n megatts3-env python=3.10
conda activate megatts3-env
pip install -r requirements.txt
conda install -y -c conda-forge pynini==2.1.5
pip install WeTextProcessing==1.0.3
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
set PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%"
$env:PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%"
conda env config vars set PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%"
set CUDA_VISIBLE_DEVICES=0
$env:CUDA_VISIBLE_DEVICES=0
依赖安装(Docker方式)
docker build . -t megatts3:latest
docker run -it -p 7929:7929 --gpus all -e CUDA_VISIBLE_DEVICES=0 megatts3:latest
docker run -it -p 7929:7929 megatts3:latest
[!提示]
[重要说明]
出于安全考虑,我们未在上述链接中上传WaveVAE编码器参数。您只能使用链接1中的预提取潜在特征进行推理。如需为说话人A合成语音,需确保"A.wav"和"A.npy"位于同一目录。如有任何问题或建议,请通过邮件联系我们。
本项目主要用于学术目的。如需评估学术数据集,可将音频上传至链接2的语音请求队列(每段不超过24秒)。经安全验证后,我们将尽快将潜在特征文件上传至链接1。
未来我们将准备并发布一些常见TTS基准的潜在表示。
推理
命令行使用(标准模式)
python tts/infer_cli.py --input_wav 'assets/Chinese_prompt.wav' --input_text "另一边的桌上,一位读书人嗤之以鼻道,'佛子三藏,神子燕小鱼是什么样的人物,李家的那个李子夜如何与他们相提并论?'" --output_dir ./gen
python tts/infer_cli.py --input_wav 'assets/English_prompt.wav' --input_text 'As his long promised tariff threat turned into reality this week, top human advisers began fielding a wave of calls from business leaders, particularly in the automotive sector, along with lawmakers who were sounding the alarm.' --output_dir ./gen --p_w 2.0 --t_w 3.0
命令行使用(带口音TTS)
python tts/infer_cli.py --input_wav 'assets/English_prompt.wav' --input_text '这是一条有口音的音频。' --output_dir ./gen --p_w 1.0 --t_w 3.0
python tts/infer_cli.py --input_wav 'assets/English_prompt.wav' --input_text '这条音频的发音标准一些了吗?' --output_dir ./gen --p_w 2.5 --t_w 2.5
网页界面使用
python tts/gradio_api.py
安全
如果您发现本项目存在潜在安全问题,或认为可能发现了安全漏洞,请通过字节跳动安全中心或邮箱sec@bytedance.com联系我们。
请勿创建公开issue。
许可证
本项目采用Apache-2.0许可证。
BibTeX引用信息
本仓库包含论文《稀疏对齐增强的潜在扩散Transformer零样本语音合成》的强制对齐版本,其中WavVAE主要基于《Wavtokenizer: 一种高效的音频离散编解码标记器》。相比论文描述的模型,仓库包含额外模型。这些模型不仅增强了算法稳定性和克隆能力,还可独立应用于更广泛的场景。
@article{jiang2025sparse,
title={稀疏对齐增强的潜在扩散Transformer零样本语音合成},
author={江子越 and 任毅 and 李瑞琪 and 纪盛鹏 and 叶振辉 and 张晨 and 白江浩 and 杨晓达 and 左嘉龙 and 张宇等},
journal={arXiv预印本 arXiv:2502.18924},
year={2025}
}
@article{ji2024wavtokenizer,
title={Wavtokenizer: 一种高效的音频离散编解码标记器},
author={纪盛鹏 and 江子越 and 王文 and 陈逸夫 and 方明辉 and 左嘉龙 and 杨倩 and 程希泽 and 王泽涵 and 李瑞琪等},
journal={arXiv预印本 arXiv:2408.16532},
year={2024}
}