SparkAudio/Spark-TTS-0.5B 已完整同步
license: cc-by-nc-sa-4.0 language:
- en
- zh tags:
- text-to-speech
library_tag: spark-tts
Spark-TTS
Official model for
Spark-TTS: An Efficient LLM-Based Text-to-Speech Model with Single-Stream Decoupled Speech Tokens
</p>
Spark-TTS 🔥
👉🏻 Spark-TTS Demos 👈🏻
👉🏻 Github Repo 👈🏻
👉🏻 Paper 👈🏻
Overview
Spark-TTS is an advanced text-to-speech system that uses the power of large language models (LLM) for highly accurate and natural-sounding voice synthesis. It is designed to be efficient, flexible, and powerful for both research and production use.
Key Features
- Simplicity and Efficiency: Built entirely on Qwen2.5, Spark-TTS eliminates the need for additional generation models like flow matching. Instead of relying on separate models to generate acoustic features, it directly reconstructs audio from the code predicted by the LLM. This approach streamlines the process, improving efficiency and reducing complexity.
- High-Quality Voice Cloning: Supports zero-shot voice cloning, which means it can replicate a speaker's voice even without specific training data for that voice. This is ideal for cross-lingual and code-switching scenarios, allowing for seamless transitions between languages and voices without requiring separate training for each one.
- Bilingual Support: Supports both Chinese and English, and is capable of zero-shot voice cloning for cross-lingual and code-switching scenarios, enabling the model to synthesize speech in multiple languages with high naturalness and accuracy.
- Controllable Speech Generation: Supports creating virtual speakers by adjusting parameters such as gender, pitch, and speaking rate.
| Inference Overview of Voice Cloning |
| Inference Overview of Controlled Generation |
Install
Clone and Install
- Clone the repo
git clone https://github.com/SparkAudio/Spark-TTS.git
cd Spark-TTS
- Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
- Create Conda env:
conda create -n sparktts -y python=3.12
conda activate sparktts
pip install -r requirements.txt
# If you are in mainland China, you can set the mirror as follows:
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
Model Download
Download via python:
from huggingface_hub import snapshot_download
snapshot_download("SparkAudio/Spark-TTS-0.5B", local_dir="pretrained_models/Spark-TTS-0.5B")
Download via git clone:
mkdir -p pretrained_models
# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/SparkAudio/Spark-TTS-0.5B pretrained_models/Spark-TTS-0.5B
Basic Usage
You can simply run the demo with the following commands:
cd example
bash infer.sh
Alternatively, you can directly execute the following command in the command line to perform inference:
python -m cli.inference \
--text "text to synthesis." \
--device 0 \
--save_dir "path/to/save/audio" \
--model_dir pretrained_models/Spark-TTS-0.5B \
--prompt_text "transcript of the prompt audio" \
--prompt_speech_path "path/to/prompt_audio"
UI Usage
You can start the UI interface by running python webui.py, which allows you to perform Voice Cloning and Voice Creation.
31 个文件
浏览文件数据集版权信息
本数据集的许可证为 Apache License 2.0。如有违反相关条款,请联系 WEHUB,我们将及时处理。 查看许可证
通过 WeHub CLI 下载当前数据集快照。下列命令会固定为当前页面展示的数据版本(如果页面提供版本)。文件字节由本机直连存储下载,浏览器不会签发或保存下载链接。
前置要求
需要 Node.js 18 及以上,以及 npm(或 npx)。
1. 安装 CLI
npm install -g wehub-cli@latest
2. 下载此数据集
wehub datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901
若中断或部分失败,在同一目录重新执行同一命令即可续传。默认会校验 SHA-256。
免全局安装
npx --yes wehub-cli@latest datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901
高级选项
以下为 wehub datasets download 已支持的参数示例:
强制重新下载,不复用已校验的本地文件
wehub datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901 --overwrite
仅包含匹配路径
wehub datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901 --include "*.jsonl"
排除匹配路径
wehub datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901 --exclude "*.md"
提高并发下载数
wehub datasets download ds_ext_5673_2b1a977901 --revision 642071559bfc6346c2359d19dcb6be3f9dd8a05d --output ./ds_ext_5673_2b1a977901 --jobs 8
完整帮助:wehub datasets download --help