CKermit commited on
Commit
edab7e5
·
verified ·
1 Parent(s): 6739938

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +286 -0
README.md ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: FireRedTeam/FireRedTTS3
4
+ pipeline_tag: text-to-speech
5
+ tags:
6
+ - sglang-omni
7
+ - fireredtts3
8
+ - text-to-speech
9
+ - voice-cloning
10
+ ---
11
+
12
+ # FireRedTTS3-Instruct for SGLang Omni
13
+
14
+ We provide our FireRedTTS3-Instruct checkpoint for inference with
15
+ [SGLang Omni](https://github.com/sgl-project/sglang-omni). It supports
16
+ reference-audio voice cloning, instruction-guided voice design, semantic editing, and acoustic editing.
17
+ Audio output is 24 kHz mono, with WAV responses and streaming PCM available
18
+ through the `/v1/audio/speech` API.
19
+
20
+ Our model code and original checkpoint release:
21
+
22
+ - [FireRedTTS3 source code](https://github.com/FireRedTeam/FireRedTTS3)
23
+ - [Original FireRedTTS3 weights and model card](https://huggingface.co/FireRedTeam/FireRedTTS3)
24
+
25
+ This card documents the SGLang Omni loading and serving workflow.
26
+
27
+ ## Install SGLang Omni
28
+
29
+ Use Linux with an NVIDIA CUDA GPU and Python 3.12. Follow the
30
+ [SGLang Omni installation guide](https://github.com/sgl-project/sglang-omni/blob/main/docs/get_started/installation.md)
31
+ for the CUDA, UCX, and FlashAttention prerequisites, then install from source:
32
+
33
+ ```bash
34
+ git clone https://github.com/sgl-project/sglang-omni.git
35
+ cd sglang-omni
36
+ pip install uv
37
+ uv venv .venv -p 3.12
38
+ source .venv/bin/activate
39
+ uv pip install --prerelease=allow -e '.[firered-tts3]'
40
+ ```
41
+
42
+ Use a revision containing the FireRedTTS3 integration. Before that integration
43
+ is merged, check out the corresponding PR revision before installing; an older
44
+ PyPI release or checkout does not provide this model. Run the following commands
45
+ from the `sglang-omni` repository root.
46
+
47
+ ## Download this checkpoint
48
+
49
+ Replace `<HF_ORG>` with the organization or account hosting this checkpoint.
50
+ The repository ID is a publication placeholder, not a currently verified URL.
51
+
52
+ ```bash
53
+ hf download '<HF_ORG>/FireRedTTS3-Instruct' \
54
+ --local-dir ./models/FireRedTTS3-Instruct
55
+ ```
56
+
57
+ Download the complete repository, including configuration, tokenizer, and
58
+ `redae/` assets. Loading only the root
59
+ `model.safetensors` file is insufficient. If you already have the complete
60
+ checkpoint locally, use that directory directly.
61
+
62
+ ## Start the server
63
+
64
+ ```bash
65
+ CUDA_VISIBLE_DEVICES=0 sgl-omni serve \
66
+ --model-path ./models/FireRedTTS3-Instruct \
67
+ --config examples/configs/firered_tts3_instruct.yaml \
68
+ --allowed-local-media-path "$PWD/docs/_static/audio" \
69
+ --port 8000
70
+ ```
71
+
72
+ Wait for `/health` to return HTTP 200 before sending requests. Initial model
73
+ loading, compilation, and warmup can take several minutes.
74
+
75
+ The reference clips below are included in the SGLang Omni repository. Local
76
+ paths are resolved on the **server**, relative to its working directory.
77
+ For your own clips, allow their directory with `--allowed-local-media-path`
78
+ and supply the matching transcript for cloning.
79
+
80
+ ## Voice cloning
81
+
82
+ Provide exactly one reference recording and its actual transcript. The example
83
+ uses the repository's `ref_voice.wav`:
84
+
85
+ ```bash
86
+ curl --fail-with-body -X POST http://localhost:8000/v1/audio/speech \
87
+ -H 'Content-Type: application/json' \
88
+ -d '{
89
+ "model": "FireRedTTS3-Instruct",
90
+ "input": "Hello, welcome to SGLang Omni.",
91
+ "language": "English",
92
+ "references": [{
93
+ "audio_path": "docs/_static/audio/ref_voice.wav",
94
+ "text": "It was the night before my birthday. Hooray! It’s almost here! It may not be a holiday, but it’s the best day of the year."
95
+ }],
96
+ "seed": 42
97
+ }' --output clone.wav
98
+ ```
99
+
100
+ Omit `task_type` for cloning, or set it to `Base`. The value `tts` is not an
101
+ accepted serving task name.
102
+
103
+ ## Voice design
104
+
105
+ Generate a voice from a description, without a reference recording:
106
+
107
+ ```bash
108
+ curl --fail-with-body -X POST http://localhost:8000/v1/audio/speech \
109
+ -H 'Content-Type: application/json' \
110
+ -d '{
111
+ "model": "FireRedTTS3-Instruct",
112
+ "input": "Good evening, and welcome to the show.",
113
+ "task_type": "VoiceDesign",
114
+ "instructions": "A young woman with a gentle voice, speaking slowly.",
115
+ "seed": 42
116
+ }' --output voice_design.wav
117
+ ```
118
+
119
+ ## Semantic editing
120
+
121
+ Use the reference recording as the source to edit. Its content supplies the
122
+ input, so `input` may be empty; no reference transcript is required:
123
+
124
+ ```bash
125
+ curl --fail-with-body -X POST http://localhost:8000/v1/audio/speech \
126
+ -H 'Content-Type: application/json' \
127
+ -d '{
128
+ "model": "FireRedTTS3-Instruct",
129
+ "input": "",
130
+ "task_type": "SemanticEdit",
131
+ "instructions": "Replace birthday with anniversary.",
132
+ "ref_audio": "docs/_static/audio/ref_voice.wav",
133
+ "seed": 42
134
+ }' --output semantic_edit.wav
135
+ ```
136
+
137
+ ## Acoustic editing
138
+
139
+ Adjust the source recording's speed, pitch, or volume. This example requests
140
+ 0.8x speed through the model's native acoustic-edit task:
141
+
142
+ ```bash
143
+ curl --fail-with-body -X POST http://localhost:8000/v1/audio/speech \
144
+ -H 'Content-Type: application/json' \
145
+ -d '{
146
+ "model": "FireRedTTS3-Instruct",
147
+ "input": "",
148
+ "task_type": "AcousticEdit",
149
+ "ref_audio": "docs/_static/audio/ref_voice.wav",
150
+ "speed": 0.8,
151
+ "seed": 42
152
+ }' --output acoustic_edit.wav
153
+ ```
154
+
155
+ For pitch or volume, supply the trained instruction template, for example
156
+ `"instructions": "shift the pitch by 2 steps"` or
157
+ `"instructions": "adjust the volume to 0.8"`. An explicit `instructions`
158
+ string takes precedence over the composed speed instruction. The `speed`
159
+ field applies to `AcousticEdit`; it does not change cloning or voice design.
160
+ Edit sources are capped at 20 seconds. VoiceDesign and SemanticEdit generate
161
+ text before audio, so their first-audio latency differs from cloning.
162
+
163
+ ## Streaming
164
+
165
+ To stream audio, add `"stream": true` and `"response_format": "pcm"` to
166
+ the request and use `curl -N`. The response contains raw **24 kHz, signed
167
+ 16-bit little-endian, mono PCM**. Save it as `output.pcm` and convert it with:
168
+
169
+ ```bash
170
+ ffmpeg -f s16le -ar 24000 -ac 1 -i output.pcm output.wav
171
+ ```
172
+
173
+ The server also exposes `/v1/audio/speech/stream` over WebSocket. See the
174
+ [WebSocket protocol](https://github.com/sgl-project/sglang-omni/blob/main/docs/basic_usage/tts.md#websocket-speech-streaming)
175
+ for `session.config`, `input.text`, `input.commit`, and `input.done` events.
176
+
177
+ ## Offline Python SDK
178
+
179
+ Save this as `offline_tts.py` in the SGLang Omni repository root and run
180
+ `CUDA_VISIBLE_DEVICES=0 python offline_tts.py`. This starts the pipeline
181
+ locally without an HTTP server.
182
+
183
+ ```python
184
+ import asyncio
185
+ import multiprocessing as mp
186
+ from pathlib import Path
187
+
188
+ from sglang_omni.client import Client, GenerateRequest
189
+ from sglang_omni.models.firered_tts3.config import FireRedTTS3PipelineConfig
190
+ from sglang_omni.pipeline.mp_runner import MultiProcessPipelineRunner
191
+
192
+
193
+ async def main() -> None:
194
+ config = FireRedTTS3PipelineConfig(
195
+ model_path="./models/FireRedTTS3-Instruct",
196
+ )
197
+ config.stage_named("talker").factory.flow_mode = "fp32"
198
+ runner = MultiProcessPipelineRunner(config)
199
+ await runner.start(timeout=600)
200
+ try:
201
+ client = Client(runner.coordinator)
202
+ result = await client.speech(
203
+ GenerateRequest(
204
+ prompt={
205
+ "input": "Good evening, and welcome to the show.",
206
+ "task_type": "VoiceDesign",
207
+ "instructions": "A young woman with a gentle voice.",
208
+ "seed": 42,
209
+ },
210
+ stream=False,
211
+ ),
212
+ request_id="demo-1",
213
+ )
214
+ Path("offline.wav").write_bytes(result.audio_bytes)
215
+ finally:
216
+ await runner.stop()
217
+
218
+
219
+ if __name__ == "__main__":
220
+ mp.set_start_method("spawn", force=True)
221
+ asyncio.run(main())
222
+ ```
223
+
224
+ ## Serving notes
225
+
226
+ - The current deployment supports a single GPU (`tp_size=1`).
227
+ - HTTP `input` is limited to 400 characters. Editing requests may use an empty
228
+ `input` as shown above.
229
+ - Use an explicit language: `Chinese` (default), `English`, `Japanese`, `Korean`,
230
+ `German`, `French`, `Russian`, `Portuguese`, `Spanish`, or `Italian`.
231
+ Automatic language detection (`Auto`) is unsupported. These are the stock
232
+ serving API's accepted language values; FireRedTTS3 supports additional
233
+ languages and dialects through our standalone inference pipeline.
234
+ - Submit spoken-form text when normalization is needed. The FastText and LLM
235
+ text-normalization setup in our standalone pipeline is not used in this quick start.
236
+ - Put flow-solver settings under `stage_params.talker`, for example
237
+ `{"n_timesteps": 10, "inference_cfg": 2.0, "max_patches": 200}`. Unknown
238
+ top-level fields are not forwarded as model settings.
239
+ - `seed` controls the per-request flow sampler. Different precisions, hardware,
240
+ or batching schedules can produce different results with the same seed.
241
+ - For our published model-quality results, see the
242
+ [FireRedTTS3 model card](https://huggingface.co/FireRedTeam/FireRedTTS3).
243
+ SGLang Omni runtime accuracy and performance are evaluated separately.
244
+ - Keep the example Instruct configuration's `flow_mode: fp32` for the
245
+ supported default. The offline example sets it explicitly because it does
246
+ not load the example YAML.
247
+ - `temperature`, `top_p`, and `top_k` affect the VoiceDesign/SemanticEdit text
248
+ phase. They do not control continuous-latent audio generation.
249
+ - SGLang Omni and our standalone inference pipeline can produce different
250
+ SemanticEdit outputs. Validate the edits on your own recordings.
251
+
252
+ See the [FireRedTTS3 cookbook](https://github.com/sgl-project/sglang-omni/blob/main/docs/cookbook/firered_tts3.md)
253
+ for the full request parameters and deployment configuration.
254
+
255
+ ## Usage Disclaimer
256
+
257
+ - The project incorporates zero-shot voice cloning functionality; Please note that this capability is intended **solely for academic research purposes**.
258
+ - **DO NOT** use this model for **ANY illegal activities**❗️❗️
259
+ - The developers assume no liability for any misuse of this model.
260
+ - If you identify any instances of **abuse**, **misuse**, or **fraudulent** activities related to this project, **please report them to our team immediately.**
261
+
262
+ ## Citation
263
+
264
+ ```bib
265
+ @article{fireredtts3,
266
+ title = {FireRedTTS3: Unified Speech Generation and Editing with Semantically Enriched Speech Representations},
267
+ author = {FireRed Team},
268
+ journal = {arXiv preprint},
269
+ year = {2026},
270
+ }
271
+ ```
272
+
273
+ ## Acknowledgements
274
+
275
+ - [Qwen3](https://github.com/QwenLM/Qwen3) and [Qwen2-Audio](https://github.com/QwenLM/Qwen2-Audio) for the language model and audio understanding foundations
276
+ - <u>DiTAR</u> for the patch-level diffusion autoregressive formulation
277
+ - [X-Codec](https://github.com/zhenye234/xcodec) for the discriminator design used in RedAE training
278
+ - [CAM++](https://modelscope.cn/models/iic/speech_campplus_sv_en_voxceleb_16k) for speaker embedding extraction
279
+ - [fastText](https://fasttext.cc/docs/en/language-identification.html) for automatic language identification
280
+ - [WeTextProcessing](https://github.com/wenet-e2e/WeTextProcessing) (wetext) for the Chinese / English text normalization front-end
281
+
282
+ ## License
283
+
284
+ FireRedTTS3 is released under [Apache-2.0](https://github.com/FireRedTeam/FireRedTTS3/blob/main/LICENSE).
285
+ See our [original model card](https://huggingface.co/FireRedTeam/FireRedTTS3)
286
+ for usage guidance and model evaluation details.