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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
<div align="center">
|
| 5 |
+
<h1>
|
| 6 |
+
FireRedTTS-2
|
| 7 |
+
</h1>
|
| 8 |
+
<p>
|
| 9 |
+
Official PyTorch code for <br>
|
| 10 |
+
<b><em>FireRedTTS-2: Towards Long Conversational Speech Generation for Podcast and Chatbot</em></b>
|
| 11 |
+
</p>
|
| 12 |
+
<a href="https://arxiv.org/abs/2509.02020"><img src="https://img.shields.io/badge/Paper-ArXiv-red" alt="technical report"></a>
|
| 13 |
+
<a href="https://fireredteam.github.io/demos/firered_tts_2/"><img src="https://img.shields.io/badge/Demo-Page-lightgrey" alt="version"></a>
|
| 14 |
+
<a href="https://huggingface.co/FireRedTeam/FireRedTTS2"><img src="https://img.shields.io/badge/Hugging%20Face-Model%20Page-yellow" alt="HF-model"></a>
|
| 15 |
+
<a href="https://github.com/FireRedTeam/FireRedTTS"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="Apache-2.0"></a>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
## Overview
|
| 19 |
+
|
| 20 |
+
FireRedTTS‑2 is a long-form streaming TTS system for **multi-speaker dialogue generation**, delivering stable, natural speech with reliable speaker switching and context-aware prosody.
|
| 21 |
+
|
| 22 |
+
## Highlight🔥
|
| 23 |
+
|
| 24 |
+
- **Long Conversational Speech Generation**: It currently supports 3 minutes dialogues with 4 speakers and can be easily scaled to longer conversations
|
| 25 |
+
with more speakers by extending training corpus.
|
| 26 |
+
- **Multilingual Support**: It supports multiple languages including English, Chinese, Japanese, Korean, French, German, and Russian. Support zero-shot voice cloning for cross-lingual and code-switching scenarios.
|
| 27 |
+
- **Ultra-Low Latency**: Building on the new **12.5Hz streaming** speech tokenizer, we employ a dual-transformer architecture that operates on a text–speech interleaved sequence, enabling flexible sentence-bysentence generation and reducing first-packet latency,Specifically, on an L20 GPU, our first-packet latency as low as 140ms while maintaining high-quality audio output.
|
| 28 |
+
- **Strong Stability**:Our model achieves high similarity and low WER/CER in both monologue and dialogue tests.
|
| 29 |
+
- **Random Timbre Generation**:Useful for creating ASR/speech interaction data.
|
| 30 |
+
|
| 31 |
+
## Demo Examples
|
| 32 |
+
|
| 33 |
+
For more examples, see [demo page](https://fireredteam.github.io/demos/firered_tts_2/).
|
| 34 |
+
|
| 35 |
+
## News
|
| 36 |
+
|
| 37 |
+
- [2025/09/12] 🔥 **We have added a UI tool to the dialogue generation.**
|
| 38 |
+
- [2025/09/08] 🔥 We release the [pre-trained checkpoints](https://huggingface.co/FireRedTeam/FireRedTTS2) and inference code.
|
| 39 |
+
- [2025/09/02] 🔥 We release the [technical report](https://arxiv.org/abs/2509.02020) and [demo page](https://fireredteam.github.io/demos/firered_tts_2/)
|
| 40 |
+
|
| 41 |
+
## Roadmap
|
| 42 |
+
|
| 43 |
+
- [x] 2025/09
|
| 44 |
+
- [x] Release the pre-trained checkpoints and inference code.
|
| 45 |
+
- [x] Add web UI tool.
|
| 46 |
+
|
| 47 |
+
- [ ] 2025/10
|
| 48 |
+
- [ ] Release a base model with enhanced multilingual support.
|
| 49 |
+
- [ ] **Provide fine-tuning code & tutorial for specific dialogue/multilingual data.**
|
| 50 |
+
- [ ] **End-to-end text-to-blog pipeline.**
|
| 51 |
+
|
| 52 |
+
## Install & Model Download
|
| 53 |
+
|
| 54 |
+
### Clone and install
|
| 55 |
+
|
| 56 |
+
- **Clone the repo**
|
| 57 |
+
|
| 58 |
+
``` sh
|
| 59 |
+
git clone https://github.com/FireRedTeam/FireRedTTS2.git
|
| 60 |
+
cd FireRedTTS2
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
- **Create Conda env**:
|
| 64 |
+
|
| 65 |
+
``` sh
|
| 66 |
+
conda create --name fireredtts2 python==3.11
|
| 67 |
+
conda activate fireredtts2
|
| 68 |
+
|
| 69 |
+
# Step 1. PyTorch Installation (if required)
|
| 70 |
+
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu126
|
| 71 |
+
|
| 72 |
+
# Step 2. Install Dependencies
|
| 73 |
+
pip install -e .
|
| 74 |
+
pip install -r requirements.txt
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
- **Model download**
|
| 78 |
+
|
| 79 |
+
```sh
|
| 80 |
+
git lfs install
|
| 81 |
+
git clone https://huggingface.co/FireRedTeam/FireRedTTS2 pretrained_models/FireRedTTS2
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Basic Usage
|
| 85 |
+
|
| 86 |
+
**Dialogue Generation with Web UI**
|
| 87 |
+
|
| 88 |
+
Generate dialogue through an easy-to-use web interface that supports both voice cloning and randomized voices.
|
| 89 |
+
|
| 90 |
+
```sh
|
| 91 |
+
python gradio_demo.py --pretrained-dir "./pretrained_models/FireRedTTS2"
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
**Dialogue Generation**
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
import os
|
| 99 |
+
import sys
|
| 100 |
+
import torch
|
| 101 |
+
import torchaudio
|
| 102 |
+
from fireredtts2.fireredtts2 import FireRedTTS2
|
| 103 |
+
|
| 104 |
+
device = "cuda"
|
| 105 |
+
|
| 106 |
+
fireredtts2 = FireRedTTS2(
|
| 107 |
+
pretrained_dir="./pretrained_models/FireRedTTS2",
|
| 108 |
+
gen_type="dialogue",
|
| 109 |
+
device=device,
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
text_list = [
|
| 113 |
+
"[S1]那可能说对对,没有去过美国来说去去看到美国线下。巴斯曼也好,沃尔玛也好,他们线下不管说,因为深圳出去的还是电子周边的会表达,会发现哇对这个价格真的是很高呀。都是卖三十五美金、四十美金,甚至一个手机壳,就是二十五美金开。",
|
| 114 |
+
"[S2]对,没错,我每次都觉得不不可思议。我什么人会买三五十美金的手机壳?但是其实在在那个target啊,就塔吉特这种超级市场,大家都是这样的,定价也很多人买。",
|
| 115 |
+
"[S1]对对,那这样我们再去看说亚马逊上面卖卖卖手机壳也好啊,贴膜也好,还包括说车窗也好,各种线材也好,大概就是七块九九或者说啊八块九九,这个价格才是卖的最多的啊。因为亚马逊的游戏规则限定的。如果说你卖七块九九以下,那你基本上是不赚钱的。",
|
| 116 |
+
"[S2]那比如说呃除了这个可能去到海外这个调查,然后这个调研考察那肯定是最直接的了。那平时我知道你是刚才建立了一个这个叫做呃rean的这样的一个一个播客,它是一个英文的。然后平时你还听一些什么样的东西,或者是从哪里获取一些这个海外市场的一些信息呢?",
|
| 117 |
+
"[S1]嗯,因为做做亚马逊的话呢,我们会关注很多行业内的东西。就比如说行业有什么样亚马逊有什么样新的游戏规则呀。呃,物流的价格有没有波动呀,包括说有没有什么新的评论的政策呀,广告有什么新的打法呀?那这些我们会会关关注很多行业内部的微信公众号呀,还包括去去查一些知乎专栏的文章呀,以及说我们周边有很多同行。那我们经常会坐在一起聊天,看看信息有什么共享。那这个是关注内内的一个方式。",
|
| 118 |
+
]
|
| 119 |
+
prompt_wav_list = [
|
| 120 |
+
"examples/chat_prompt/zh/S1.flac",
|
| 121 |
+
"examples/chat_prompt/zh/S2.flac",
|
| 122 |
+
]
|
| 123 |
+
|
| 124 |
+
prompt_text_list = [
|
| 125 |
+
"[S1]啊,可能说更适合美国市场应该是什么样子。那这这个可能说当然如果说有有机会能亲身的去考察去了解一下,那当然是有更好的帮助。",
|
| 126 |
+
"[S2]比如具体一点的,他觉得最大的一个跟他预想的不一样的是在什么地方。",
|
| 127 |
+
]
|
| 128 |
+
|
| 129 |
+
all_audio = fireredtts2.generate_dialogue(
|
| 130 |
+
text_list=text_list,
|
| 131 |
+
prompt_wav_list=prompt_wav_list,
|
| 132 |
+
prompt_text_list=prompt_text_list,
|
| 133 |
+
temperature=0.9,
|
| 134 |
+
topk=30,
|
| 135 |
+
)
|
| 136 |
+
torchaudio.save("chat_clone.wav", all_audio, 24000)
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
**Monologue Generation**
|
| 140 |
+
|
| 141 |
+
```python
|
| 142 |
+
import os
|
| 143 |
+
import sys
|
| 144 |
+
import torch
|
| 145 |
+
import torchaudio
|
| 146 |
+
from fireredtts2.fireredtts2 import FireRedTTS2
|
| 147 |
+
|
| 148 |
+
device = "cuda"
|
| 149 |
+
lines = [
|
| 150 |
+
"Hello everyone, welcome to our newly launched FireRedTTS2. It supports multiple languages including English, Chinese, Japanese, Korean, French, German, and Russian. Additionally, this TTS model features long-context dialogue generation capabilities.",
|
| 151 |
+
"如果你厌倦了千篇一律的AI音色,不满意于其他模型语言支持不够丰富,那么本项目将会成为你绝佳的工具。",
|
| 152 |
+
"ランダムな話者と言語を選択して合成できます",
|
| 153 |
+
"이는 많은 인공지능 시스템에 유용합니다. 예를 들어, 제가 다양한 음성 데이터를 대량으로 생성해 여러분의 ASR 모델이나 대화 모델에 풍부한 데이터를 제공할 수 있습니다.",
|
| 154 |
+
"J'évolue constamment et j'espère pouvoir parler davantage de langues avec plus d'aisance à l'avenir.",
|
| 155 |
+
]
|
| 156 |
+
|
| 157 |
+
fireredtts2 = FireRedTTS2(
|
| 158 |
+
pretrained_dir="./pretrained_models/FireRedTTS2",
|
| 159 |
+
gen_type="monologue",
|
| 160 |
+
device=device,
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
# random speaker
|
| 164 |
+
for i in range(len(lines)):
|
| 165 |
+
text = lines[i].strip()
|
| 166 |
+
audio = fireredtts2.generate_monologue(text=text)
|
| 167 |
+
# adjust temperature & topk
|
| 168 |
+
# audio = fireredtts2.generate_monologue(text=text, temperature=0.8, topk=30)
|
| 169 |
+
torchaudio.save(str(i) + ".wav", audio.cpu(), 24000)
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
# # voice clone
|
| 173 |
+
# for i in range(len(lines)):
|
| 174 |
+
# text = lines[i].strip()
|
| 175 |
+
|
| 176 |
+
# audio = fireredtts2.generate_monologue(
|
| 177 |
+
# text=text,
|
| 178 |
+
# prompt_wav=<prompt_wav_path>,
|
| 179 |
+
# prompt_text=<prompt_wav_text>,
|
| 180 |
+
# )
|
| 181 |
+
# torchaudio.save(str(i) + ".wav", audio.cpu(), 24000)
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
## ⚠️ Usage Disclaimer ❗️❗️❗️❗️❗️❗️
|
| 185 |
+
|
| 186 |
+
- The project incorporates zero-shot voice cloning functionality; Please note that this capability is intended **solely for academic research purposes**.
|
| 187 |
+
- **DO NOT** use this model for **ANY illegal activities**❗️❗️❗️❗️❗️❗️
|
| 188 |
+
- The developers assume no liability for any misuse of this model.
|
| 189 |
+
- If you identify any instances of **abuse**, **misuse**, or **fraudulent** activities related to this project, **please report them to our team immediately.**
|