aluminumbox commited on
Commit
98f1a96
·
verified ·
1 Parent(s): 933eae1

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +257 -9
README.md CHANGED
@@ -1,13 +1,261 @@
1
  ---
2
- title: Fun-CosyVoice3-0.5B
3
- emoji: 📈
4
- colorFrom: green
5
- colorTo: yellow
6
  sdk: gradio
7
- sdk_version: 6.1.0
8
- python_version: 3.9
9
  app_file: app.py
10
- pinned: false
11
- license: unknown
12
- short_description: demo page for Fun-CosyVoice3-0.5B
13
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: CosyVoice2-0.5B
3
+ emoji: 🥳
4
+ colorFrom: red
5
+ colorTo: blue
6
  sdk: gradio
 
 
7
  app_file: app.py
8
+ pinned: true
9
+ sdk_version: 5.9.0
 
10
  ---
11
+
12
+
13
+ [![SVG Banners](https://svg-banners.vercel.app/api?type=origin&text1=CosyVoice🤠&text2=Text-to-Speech%20💖%20Large%20Language%20Model&width=800&height=210)](https://github.com/Akshay090/svg-banners)
14
+
15
+ ## 👉🏻 CosyVoice 👈🏻
16
+
17
+ **Fun-CosyVoice 3.0**: [Demos](https://funaudiollm.github.io/cosyvoice3/); [Paper](https://arxiv.org/abs/2505.17589); [Modelscope](https://www.modelscope.cn/studios/FunAudioLLM/Fun-CosyVoice3-0.5B); [CV3-Eval](https://github.com/FunAudioLLM/CV3-Eval)
18
+
19
+ **CosyVoice 2.0**: [Demos](https://funaudiollm.github.io/cosyvoice2/); [Paper](https://arxiv.org/abs/2412.10117); [Modelscope](https://www.modelscope.cn/studios/iic/CosyVoice2-0.5B); [HuggingFace](https://huggingface.co/spaces/FunAudioLLM/CosyVoice2-0.5B)
20
+
21
+ **CosyVoice 1.0**: [Demos](https://fun-audio-llm.github.io); [Paper](https://funaudiollm.github.io/pdf/CosyVoice_v1.pdf); [Modelscope](https://www.modelscope.cn/studios/iic/CosyVoice-300M)
22
+
23
+ ## Highlight🔥
24
+
25
+ **Fun-CosyVoice 3.0** is an advanced text-to-speech (TTS) system based on large language models (LLM), surpassing its predecessor (CosyVoice 2.0) in content consistency, speaker similarity, and prosody naturalness. It is designed for zero-shot multilingual speech synthesis in the wild.
26
+ ### Key Features
27
+ - **Language Coverage**: Covers 9 common languages (Chinese, English, Japanese, Korean, German, Spanish, French, Italian, Russian), 18+ Chinese dialects/accents (Guangdong, Minnan, Sichuan, Dongbei, Shan3xi, Shan1xi, Shanghai, Tianjin, Shan1dong, Ningxia, Gansu, etc.) and meanwhile supports both multi-lingual/cross-lingual zero-shot voice cloning.
28
+ - **Content Consistency & Naturalness**: Achieves state-of-the-art performance in content consistency, speaker similarity, and prosody naturalness.
29
+ - **Pronunciation Inpainting**: Supports pronunciation inpainting of Chinese Pinyin and English CMU phonemes, providing more controllability and thus suitable for production use.
30
+ - **Text Normalization**: Supports reading of numbers, special symbols and various text formats without a traditional frontend module.
31
+ - **Bi-Streaming**: Support both text-in streaming and audio-out streaming, and achieves latency as low as 150ms while maintaining high-quality audio output.
32
+ - **Instruct Support**: Supports various instructions such as languages, dialects, emotions, speed, volume, etc.
33
+
34
+
35
+ ## Roadmap
36
+
37
+ - [x] 2025/12
38
+
39
+ - [x] release Fun-CosyVoice3-0.5B-2512 base model, rl model and its training/inference script
40
+ - [x] release Fun-CosyVoice3-0.5B modelscope gradio space
41
+
42
+ - [x] 2025/08
43
+
44
+ - [x] Thanks to the contribution from NVIDIA Yuekai Zhang, add triton trtllm runtime support and cosyvoice2 grpo training support
45
+
46
+ - [x] 2025/07
47
+
48
+ - [x] release Fun-CosyVoice 3.0 eval set
49
+
50
+ - [x] 2025/05
51
+
52
+ - [x] add CosyVoice2-0.5B vllm support
53
+
54
+ - [x] 2024/12
55
+
56
+ - [x] 25hz CosyVoice2-0.5B released
57
+
58
+ - [x] 2024/09
59
+
60
+ - [x] 25hz CosyVoice-300M base model
61
+ - [x] 25hz CosyVoice-300M voice conversion function
62
+
63
+ - [x] 2024/08
64
+
65
+ - [x] Repetition Aware Sampling(RAS) inference for llm stability
66
+ - [x] Streaming inference mode support, including kv cache and sdpa for rtf optimization
67
+
68
+ - [x] 2024/07
69
+
70
+ - [x] Flow matching training support
71
+ - [x] WeTextProcessing support when ttsfrd is not available
72
+ - [x] Fastapi server and client
73
+
74
+ ## Evaluation
75
+ | Model | CER (%) ↓ (test-zh) | WER (%) ↓ (test-en) | CER (%) ↓ (test-hard) |
76
+ |-----|------------------|------------------|------------------|
77
+ | Human | 1.26 | 2.14 | - |
78
+ | F5-TTS | 1.53 | 2.00 | 8.67 |
79
+ | SparkTTS | 1.20 | 1.98 | - |
80
+ | Seed-TTS | 1.12 | 2.25 | 7.59 |
81
+ | CosyVoice2 | 1.45 | 2.57 | 6.83 |
82
+ | FireRedTTS-2 | 1.14 | 1.95 | - |
83
+ | IndexTTS2 | 1.01 | 1.52 | 7.12 |
84
+ | VibeVoice | 1.16 | 3.04 | - |
85
+ | HiggsAudio | 1.79 | 2.44 | - |
86
+ | MiniMax-Speech | 0.83 | 1.65 | - |
87
+ | VoxPCM | 0.93 | 1.85 | 8.87 |
88
+ | GLM-TTS | 1.03 | - | - |
89
+ | GLM-TTS_RL | 0.89 | - | - |
90
+ | Fun-CosyVoice3-0.5B-2512 | 1.21 | 2.24 | 6.71 |
91
+ | Fun-CosyVoice3-0.5B-2512_RL | 0.81 | 1.68 | 5.44 |
92
+
93
+
94
+ ## Install
95
+
96
+ ### Clone and install
97
+
98
+ - Clone the repo
99
+ ``` sh
100
+ git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
101
+ # If you failed to clone the submodule due to network failures, please run the following command until success
102
+ cd CosyVoice
103
+ git submodule update --init --recursive
104
+ ```
105
+
106
+ - Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
107
+ - Create Conda env:
108
+
109
+ ``` sh
110
+ conda create -n cosyvoice -y python=3.10
111
+ conda activate cosyvoice
112
+ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
113
+
114
+ # If you encounter sox compatibility issues
115
+ # ubuntu
116
+ sudo apt-get install sox libsox-dev
117
+ # centos
118
+ sudo yum install sox sox-devel
119
+ ```
120
+
121
+ ### Model download
122
+
123
+ We strongly recommend that you download our pretrained `Fun-CosyVoice3-0.5B` `CosyVoice2-0.5B` `CosyVoice-300M` `CosyVoice-300M-SFT` `CosyVoice-300M-Instruct` model and `CosyVoice-ttsfrd` resource.
124
+
125
+ ``` python
126
+ # SDK模型下载
127
+ from modelscope import snapshot_download
128
+ snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')
129
+ snapshot_download('iic/CosyVoice2-0.5B', local_dir='pretrained_models/CosyVoice2-0.5B')
130
+ snapshot_download('iic/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M')
131
+ snapshot_download('iic/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT')
132
+ snapshot_download('iic/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct')
133
+ snapshot_download('iic/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')
134
+ ```
135
+
136
+ Optionally, you can unzip `ttsfrd` resource and install `ttsfrd` package for better text normalization performance.
137
+
138
+ Notice that this step is not necessary. If you do not install `ttsfrd` package, we will use wetext by default.
139
+
140
+ ``` sh
141
+ cd pretrained_models/CosyVoice-ttsfrd/
142
+ unzip resource.zip -d .
143
+ pip install ttsfrd_dependency-0.1-py3-none-any.whl
144
+ pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
145
+ ```
146
+
147
+ ### Basic Usage
148
+
149
+ We strongly recommend using `Fun-CosyVoice3-0.5B` for better performance.
150
+ Follow the code in `example.py` for detailed usage of each model.
151
+ ```sh
152
+ python example.py
153
+ ```
154
+
155
+ #### CosyVoice2 vllm Usage
156
+ If you want to use vllm for inference, please install `vllm==v0.9.0`. Older vllm version do not support CosyVoice2 inference.
157
+
158
+ Notice that `vllm==v0.9.0` has a lot of specific requirements, for example `torch==2.7.0`. You can create a new env to in case your hardward do not support vllm and old env is corrupted.
159
+
160
+ ``` sh
161
+ conda create -n cosyvoice_vllm --clone cosyvoice
162
+ conda activate cosyvoice_vllm
163
+ pip install vllm==v0.9.0 transformers==4.51.3 -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
164
+ python vllm_example.py
165
+ ```
166
+
167
+ #### Start web demo
168
+
169
+ You can use our web demo page to get familiar with CosyVoice quickly.
170
+
171
+ Please see the demo website for details.
172
+
173
+ ``` python
174
+ # change iic/CosyVoice-300M-SFT for sft inference, or iic/CosyVoice-300M-Instruct for instruct inference
175
+ python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
176
+ ```
177
+
178
+ #### Advanced Usage
179
+
180
+ For advanced users, we have provided training and inference scripts in `examples/libritts/cosyvoice/run.sh`.
181
+
182
+ #### Build for deployment
183
+
184
+ Optionally, if you want service deployment,
185
+ You can run the following steps.
186
+
187
+ ``` sh
188
+ cd runtime/python
189
+ docker build -t cosyvoice:v1.0 .
190
+ # change iic/CosyVoice-300M to iic/CosyVoice-300M-Instruct if you want to use instruct inference
191
+ # for grpc usage
192
+ docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/grpc && python3 server.py --port 50000 --max_conc 4 --model_dir iic/CosyVoice-300M && sleep infinity"
193
+ cd grpc && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
194
+ # for fastapi usage
195
+ docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/fastapi && python3 server.py --port 50000 --model_dir iic/CosyVoice-300M && sleep infinity"
196
+ cd fastapi && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
197
+ ```
198
+
199
+ #### Using Nvidia TensorRT-LLM for deployment
200
+
201
+ Using TensorRT-LLM to accelerate cosyvoice2 llm could give 4x acceleration comparing with huggingface transformers implementation.
202
+ To quick start:
203
+
204
+ ``` sh
205
+ cd runtime/triton_trtllm
206
+ docker compose up -d
207
+ ```
208
+ For more details, you could check [here](https://github.com/FunAudioLLM/CosyVoice/tree/main/runtime/triton_trtllm)
209
+
210
+ ## Discussion & Communication
211
+
212
+ You can directly discuss on [Github Issues](https://github.com/FunAudioLLM/CosyVoice/issues).
213
+
214
+ You can also scan the QR code to join our official Dingding chat group.
215
+
216
+ <img src="./asset/dingding.png" width="250px">
217
+
218
+ ## Acknowledge
219
+
220
+ 1. We borrowed a lot of code from [FunASR](https://github.com/modelscope/FunASR).
221
+ 2. We borrowed a lot of code from [FunCodec](https://github.com/modelscope/FunCodec).
222
+ 3. We borrowed a lot of code from [Matcha-TTS](https://github.com/shivammehta25/Matcha-TTS).
223
+ 4. We borrowed a lot of code from [AcademiCodec](https://github.com/yangdongchao/AcademiCodec).
224
+ 5. We borrowed a lot of code from [WeNet](https://github.com/wenet-e2e/wenet).
225
+
226
+ ## Citations
227
+
228
+ ``` bibtex
229
+ @article{du2024cosyvoice,
230
+ title={Cosyvoice: A scalable multilingual zero-shot text-to-speech synthesizer based on supervised semantic tokens},
231
+ author={Du, Zhihao and Chen, Qian and Zhang, Shiliang and Hu, Kai and Lu, Heng and Yang, Yexin and Hu, Hangrui and Zheng, Siqi and Gu, Yue and Ma, Ziyang and others},
232
+ journal={arXiv preprint arXiv:2407.05407},
233
+ year={2024}
234
+ }
235
+
236
+ @article{du2024cosyvoice,
237
+ title={Cosyvoice 2: Scalable streaming speech synthesis with large language models},
238
+ author={Du, Zhihao and Wang, Yuxuan and Chen, Qian and Shi, Xian and Lv, Xiang and Zhao, Tianyu and Gao, Zhifu and Yang, Yexin and Gao, Changfeng and Wang, Hui and others},
239
+ journal={arXiv preprint arXiv:2412.10117},
240
+ year={2024}
241
+ }
242
+
243
+ @article{du2025cosyvoice,
244
+ title={CosyVoice 3: Towards In-the-wild Speech Generation via Scaling-up and Post-training},
245
+ author={Du, Zhihao and Gao, Changfeng and Wang, Yuxuan and Yu, Fan and Zhao, Tianyu and Wang, Hao and Lv, Xiang and Wang, Hui and Shi, Xian and An, Keyu and others},
246
+ journal={arXiv preprint arXiv:2505.17589},
247
+ year={2025}
248
+ }
249
+
250
+ @inproceedings{lyu2025build,
251
+ title={Build LLM-Based Zero-Shot Streaming TTS System with Cosyvoice},
252
+ author={Lyu, Xiang and Wang, Yuxuan and Zhao, Tianyu and Wang, Hao and Liu, Huadai and Du, Zhihao},
253
+ booktitle={ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
254
+ pages={1--2},
255
+ year={2025},
256
+ organization={IEEE}
257
+ }
258
+ ```
259
+
260
+ ## Disclaimer
261
+ The content provided above is for academic purposes only and is intended to demonstrate technical capabilities. Some examples are sourced from the internet. If any content infringes on your rights, please contact us to request its removal.