Skip to content

Commit eb27189

Browse files
committed
update readme
1 parent fddaaf5 commit eb27189

7 files changed

+60
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ share/python-wheels/
2727
.installed.cfg
2828
*.egg
2929
MANIFEST
30+
webui_test.py
3031

3132
# PyInstaller
3233
# Usually these files are written by a python script from a template

README.md

+58-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ Spark-TTS is an advanced text-to-speech system that uses the power of large lang
3030
- **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.
3131
- **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.
3232
- **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.
33+
- **Controllable Speech Generation**: Supports creating virtual speakers by adjusting parameters such as gender, pitch, and speaking rate.
34+
35+
---
36+
37+
<table align="center">
38+
<tr>
39+
<td align="center"><b>Inference Overview of Voice Cloning</b><br><img src="src/figures/infer_voice_cloning.png" width="80%" /></td>
40+
</tr>
41+
<tr>
42+
<td align="center"><b>Inference Overview of Controlled Generation</b><br><img src="src/figures/infer_control.png" width="80%" /></td>
43+
</tr>
44+
</table>
45+
46+
47+
## To-Do List
48+
49+
- [ ] Release the Spark-TTS paper.
50+
- [ ] Release the training code.
51+
- [ ] Release the training dataset, VoxBox.
52+
3353

3454
## Install
3555
**Clone and Install**
@@ -53,7 +73,22 @@ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --tru
5373

5474
**Model Download**
5575

56-
TBD
76+
Download via python:
77+
```python
78+
from huggingface_hub import snapshot_download
79+
80+
snapshot_download("SparkAudio/Spark-TTS-0.5B", local_dir="pretrained_models/Spark-TTS-0.5B")
81+
```
82+
83+
Download via git clone:
84+
```sh
85+
mkdir -p pretrained_models
86+
87+
# Make sure you have git-lfs installed (https://git-lfs.com)
88+
git lfs install
89+
90+
git clone https://huggingface.co/SparkAudio/Spark-TTS-0.5B pretrained_models/Spark-TTS-0.5B
91+
```
5792

5893
**Basic Usage**
5994

@@ -63,6 +98,28 @@ cd example
6398
bash infer.sh
6499
```
65100

101+
Alternatively, you can directly execute the following command in the command line to perform inference:
102+
103+
``` sh
104+
python -m cli.inference \
105+
--text "text to synthesis." \
106+
--device 0 \
107+
--save_dir "path/to/save/audio" \
108+
--model_dir pretrained_models/Spark-TTS-0.5B \
109+
--prompt_text "transcript of the prompt audio" \
110+
--prompt_speech_path "path/to/prompt_audio"
111+
```
112+
113+
**UI Usage**
114+
115+
You can start the UI interface by running `python webui.py`, which allows you to perform Voice Cloning and Voice Creation. Voice Cloning supports uploading reference audio or directly recording the audio.
116+
117+
118+
| **Voice Cloning** | **Voice Creation** |
119+
|:-------------------:|:-------------------:|
120+
| ![Image 1](src/figures/gradio_TTS.png) | ![Image 2](src/figures/gradio_control.png) |
121+
122+
66123
## **Demos**
67124

68125
Here are some demos generated by Spark-TTS using zero-shot voice cloning. For more demos, visit our [demo page](https://spark-tts.github.io/).

example/infer.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cd "$root_dir" || exit
3535

3636
source sparktts/utils/parse_options.sh
3737

38-
# Run inference for each JSON file
38+
# Run inference
3939
python -m cli.inference \
4040
--text "${text}" \
4141
--device "${device}" \

src/figures/gradio_TTS.png

79.9 KB
Loading

src/figures/gradio_control.png

60.7 KB
Loading

src/figures/infer_control.png

124 KB
Loading

src/figures/infer_voice_cloning.png

105 KB
Loading

0 commit comments

Comments
 (0)