dengshiyang2003 commited on
Commit
f70de99
·
verified ·
1 Parent(s): 4ac7a45

Sync README with GitHub and host demo videos

Browse files
Files changed (2) hide show
  1. README.md +134 -41
  2. README_zh.md +133 -40
README.md CHANGED
@@ -19,58 +19,53 @@ tags:
19
 
20
  <h1 align="center">Babelfish</h1>
21
 
22
- <p align="center"><b>Low-latency, high-quality streaming simultaneous speech translation between English and Chinese</b></p>
23
 
24
  <div align="center">
25
 
26
- [![Live Demo](https://img.shields.io/badge/🤗%20Spaces-Try%20the%20Demo-ff9d00)](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT)
 
27
  [![GitHub](https://img.shields.io/badge/GitHub-Babelfish-181717?logo=github)](https://github.com/TimeKettle/Babelfish)
28
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)
29
 
30
  </div>
31
 
32
- > **Private pre-release repository**: hosts the **Babelfish-30B-A3B** FP16 weights (audio encoder + language model, 13 safetensors shards, 58 GiB). The online Space mounts [pinned revision `3aa641f`](https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/tree/3aa641fb111261acbc8bbfddb793a2c3b3f57b48). FP8 (30 GiB) and GGUF (Q8_0 / Q4_K_M) versions are prepared for the public release.
33
-
34
- ## Interactive Demo & Listening Examples
35
-
36
- [**Try the live demo ↗**](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT)
37
-
38
- To translate your own speech, open the demo, select **Record**, speak, then select **Stop**. When **Ready** appears, choose the translation direction and select **Translate**. You can also upload an audio file or try either example below directly in the demo. Sign in with a Hugging Face account that has access to this private release.
39
-
40
- ### Chinese → English
41
-
42
- <audio controls preload="metadata" src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/examples/zh_birds_and_dinosaurs.wav"></audio>
43
-
44
- **Spoken Mandarin** 但鸟类还是有很多地方跟恐龙相似。
45
-
46
- **Model translation** But birds still have many similarities to dinosaurs.
47
-
48
- The model emitted “But” at **1.28 s** and “But birds” at **1.60 s** of this 3.84 s recording.
49
-
50
- ### English → Chinese
51
-
52
- <audio controls preload="metadata" src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/examples/en_birds.wav"></audio>
53
 
54
- **Spoken English** Many people don't think about them as dinosaurs because they have feathers and can fly.
55
 
56
- **Model translation** “很多人不会把它们视为恐龙,因为它们有羽毛且能飞。”
57
 
58
- The first translated words appeared after **1.28 s** of this 4.32 s recording. These timings refer to the position in the source audio; a live request also includes upload, queue, and inference time.
59
 
60
- The audio examples come from Google FLEURS (CC BY 4.0). The Mandarin clip was trimmed, raised by 5 dB, and passed through Chrome's recorder. [Recording IDs and attribution](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT/blob/main/README.md#example-recordings) · [FLEURS](https://huggingface.co/datasets/google/fleurs) · [Audio license](https://creativecommons.org/licenses/by/4.0/)
 
 
61
 
62
- ## Introduction
63
 
64
- **Babelfish** (**Babelfish-30B-A3B**) is an end-to-end simultaneous speech-to-text translation model supporting **English → Chinese** and **Chinese → English**. Speech streams in as 16 kHz mono audio in 320 ms chunks; after each chunk, the model decides whether to emit new translation text or wait for more speech, and emitted text is never revised.
65
 
66
- The model is fine-tuned for streaming from [Qwen3-Omni-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct) (Thinker only — audio encoder and 30B-A3B MoE language model with ~3B active parameters per token; Talker, Code2Wav, and vision encoder are removed). No voice activity detection (VAD), heuristic threshold, or separate read/write policy network is required. See the technical report (link to be added) for full method details.
67
 
68
  ## Results
69
 
70
  We evaluated on every test set reported by Hy-SimulMT (FLEURS, CoVoST 2, ACL 60/60, RealSI sentences, RealSI long-form) plus MCIF long-form, 11 test sets in total, against the open Hy-SimulMT and four commercial simultaneous interpretation services.
71
 
72
  - **Quality**: the highest COMET on 10 of the 11 test sets and the highest CometKiwi on 9. Average COMET is 85.5 for English → Chinese and 80.9 for Chinese → English; the next best, Qwen3.8-LiveTranslate, has 84.3 and 79.7. The only set without the highest COMET is Chinese → English RealSI long-form, 0.2 below Seed LiveInterpret 2.0.
73
- - **Against Hy-SimulMT**: higher COMET on all 11 test sets, by 2.9 (English → Chinese) and 2.3 (Chinese → English) on average, and lower latency on 7 of them.
74
  - **Latency**: LAAL of 1.50–1.92 s for English → Chinese and 1.97–2.15 s for Chinese → English, 1.74 s and 2.08 s on average.
75
 
76
  COMET and CometKiwi are on a 0–100 scale. The best value in each column of each metric is in bold (the lowest for latency). † marks commercial services, whose latency is measured differently (see the notes below the tables).
@@ -154,23 +149,117 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
154
 
155
  </details>
156
 
157
- ## Model Versions
 
 
 
 
 
 
158
 
159
- | Version | Weights | GPU memory | Quality | Status |
160
  |---|---|---|---|---|
161
- | **Babelfish-30B-A3B (FP16)** | 58 GiB (13 shards) | 80 GB × 1, or 48 GB × 2 | used for the reported results | Available in this private repo ([pinned weights](https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/tree/3aa641fb111261acbc8bbfddb793a2c3b3f57b48)) |
162
- | **Babelfish-30B-A3B-FP8** | 30 GiB (7 shards) | 48 GB × 1 | mean COMET 0.09 lower over the 11 sets (0–100 scale) | Planned for public release |
163
- | **Babelfish-30B-A3B-GGUF** | Q8_0 30.3 GiB / Q4_K_M 17.3 GiB + 1.2 GiB mmproj | about 36 / 23 GB | on par with vLLM with the llama.cpp audio patch | Planned for public release |
 
 
 
 
 
 
164
 
165
- ## Online Demo & Inference Notes
 
 
166
 
167
- - **Streaming window**: 16 kHz mono audio in 320 ms increments, a 24-second sliding audio window, up to 256 tokens of previously committed translation as context, and a final pass with the `[audio complete]` end-of-input marker.
168
- - **Online Space vs. batch evaluation**: the [Space](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT) follows the exact decoding configuration used in the technical report comparison (two-beam search, repetition guard off, n-gram blocking off, VAD off). The report used vLLM for offline batch evaluation, whereas the Space uses Transformers on ZeroGPU to score candidate tokens with the release beam-search and windowing implementation. Hardware, numerical kernels, and batching can affect closely scored candidates, so individual words may differ slightly from the report replay. [Demo code and example recordings](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT/tree/main)
169
- - **Self-hosted serving**: the upcoming public code repository ([GitHub](https://github.com/TimeKettle/Babelfish)) provides vLLM and llama.cpp serving, a real-time WebSocket API, file-upload SSE, and offline evaluation scripts (defaulting to greedy decoding with a lightweight repetition guard; `--beams 2` reproduces the reported table).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  ## License
172
 
173
- Apache License 2.0 (see [LICENSE](LICENSE)). Fine-tuned from Qwen3-Omni-30B-A3B-Instruct (Apache License 2.0); see [NOTICE](NOTICE).
174
 
175
  ## Contributors
176
 
@@ -188,3 +277,7 @@ If Babelfish helps your work, please cite:
188
  url = {https://github.com/TimeKettle/Babelfish}
189
  }
190
  ```
 
 
 
 
 
19
 
20
  <h1 align="center">Babelfish</h1>
21
 
22
+ <p align="center"><b>Low-latency, high-quality streaming simultaneous translation between English and Chinese</b></p>
23
 
24
  <div align="center">
25
 
26
+ [![Hugging Face](https://img.shields.io/badge/Hugging%20Face-Babelfish-ffc107)](https://huggingface.co/TimeKettle)
27
+ [![ModelScope](https://img.shields.io/badge/ModelScope-Babelfish-624aff)](https://www.modelscope.cn/organization/TimeKettle)
28
  [![GitHub](https://img.shields.io/badge/GitHub-Babelfish-181717?logo=github)](https://github.com/TimeKettle/Babelfish)
29
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)
30
 
31
  </div>
32
 
33
+ <!-- Demo video source backups are kept in assets/demo_en2zh.mp4 and assets/demo_zh2en.mp4 -->
34
+ <div align="center">
35
+ <table>
36
+ <tr>
37
+ <td align="center"><b>English → Chinese</b></td>
38
+ <td align="center"><b>Chinese → English</b></td>
39
+ </tr>
40
+ <tr>
41
+ <td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/assets/demo_en2zh.mp4" width="380" controls></video></td>
42
+ <td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/assets/demo_zh2en.mp4" width="380" controls></video></td>
43
+ </tr>
44
+ </table>
45
+ <sub>The translations in the demos are generated in real time by the Babelfish-30B-A3B model released here (beam size 2).<br>The source transcript and translated speech in the UI come from separate ASR and TTS models not part of this release.</sub>
46
+ </div>
 
 
 
 
 
 
 
47
 
48
+ ## Introduction
49
 
50
+ **Babelfish-30B-A3B** is a speech-to-text simultaneous interpretation model for **English → Chinese** and **Chinese → English**: speech streams in, the model translates while listening, and text that has been output is never revised. It is fine-tuned for streaming from Qwen3-Omni-30B-A3B-Instruct (mixture of experts, about 3B parameters active per token); see the technical report (link to be added) for the method and training details.
51
 
52
+ This repository releases:
53
 
54
+ - model weights: the original FP16 model, an FP8 version (vLLM) and GGUF versions (llama.cpp);
55
+ - inference and deployment code: a web page (microphone / file upload), a real-time WebSocket API, a file upload API, a command-line client and a one-command deployment script;
56
+ - offline batch inference and evaluation scripts.
57
 
58
+ Training code and training-data construction are not released at this time.
59
 
60
+ ## News
61
 
62
+ - **2026.11.XX | Release**: Babelfish-30B-A3B with FP8 and GGUF versions, plus inference and deployment code; technical report (link to be added).
63
 
64
  ## Results
65
 
66
  We evaluated on every test set reported by Hy-SimulMT (FLEURS, CoVoST 2, ACL 60/60, RealSI sentences, RealSI long-form) plus MCIF long-form, 11 test sets in total, against the open Hy-SimulMT and four commercial simultaneous interpretation services.
67
 
68
  - **Quality**: the highest COMET on 10 of the 11 test sets and the highest CometKiwi on 9. Average COMET is 85.5 for English → Chinese and 80.9 for Chinese → English; the next best, Qwen3.8-LiveTranslate, has 84.3 and 79.7. The only set without the highest COMET is Chinese → English RealSI long-form, 0.2 below Seed LiveInterpret 2.0.
 
69
  - **Latency**: LAAL of 1.50–1.92 s for English → Chinese and 1.97–2.15 s for Chinese → English, 1.74 s and 2.08 s on average.
70
 
71
  COMET and CometKiwi are on a 0–100 scale. The best value in each column of each metric is in bold (the lowest for latency). † marks commercial services, whose latency is measured differently (see the notes below the tables).
 
149
 
150
  </details>
151
 
152
+ ## Model links
153
+
154
+ | Model | Description | Framework | Download |
155
+ |---|---|---|---|
156
+ | Babelfish-30B-A3B | original FP16 model | vLLM | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B) |
157
+ | Babelfish-30B-A3B-FP8 | FP8 (one scale per 128×128 block) | vLLM | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B-FP8) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B-FP8) |
158
+ | Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + audio encoder | llama.cpp | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B-GGUF) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B-GGUF) |
159
 
160
+ | Version | Weights | GPU memory | Quality | Use |
161
  |---|---|---|---|---|
162
+ | FP16 | 58 GiB | 80 GB × 1, or 48 GB × 2 | used for the reported results | servers |
163
+ | FP8 | 30 GiB | 48 GB × 1 | mean COMET 0.09 lower over the 11 test sets (0–100 scale) | one 48 GB GPU; native FP8 on H100 / H20 / L40S |
164
+ | GGUF Q8_0 / Q4_K_M | 30.3 / 17.3 GiB + 1.2 GiB audio encoder | about 36 / 23 GB | on par with vLLM with the llama.cpp audio patch | llama.cpp; environments without vLLM, offline jobs |
165
+
166
+ ## Deployment
167
+
168
+ > Details (environment, GPU memory, multi-GPU, HTTPS, API protocol, FAQ) are in the **[deployment guide](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT.md)**.
169
+
170
+ ### Requirements
171
 
172
+ - Linux, Python 3.10+, NVIDIA GPU: one 80 GB GPU for the FP16 model (or two 48 GB GPUs with tensor parallelism), 48 GB or more for the FP8 model;
173
+ - vLLM (tested with 0.28.0 and a 0.23 nightly, with transformers 5.13.1);
174
+ - see below for the GGUF version with llama.cpp.
175
 
176
+ ### One-command deployment (vLLM)
177
+
178
+ ```bash
179
+ git clone https://github.com/TimeKettle/Babelfish.git
180
+ cd Babelfish
181
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B
182
+ ```
183
+
184
+ This creates an environment in `.simulst/env`, installs vLLM and this project, downloads the model and starts the server. Once you see `Ready: http://127.0.0.1:8080/` it is ready; Ctrl+C stops it.
185
+
186
+ More examples:
187
+
188
+ ```bash
189
+ # download from ModelScope
190
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B --source modelscope
191
+ # NVIDIA driver supports CUDA 12.x only: install the CUDA 12.9 builds of vLLM / torch
192
+ bash scripts/deploy.sh --install --cu129 --model TimeKettle/Babelfish-30B-A3B
193
+ # existing vLLM environment, local model
194
+ bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
195
+ # FP8 version
196
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B-FP8
197
+ # tensor parallelism over two GPUs
198
+ bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
199
+ ```
200
+
201
+ Or start the server directly:
202
+
203
+ ```bash
204
+ pip install -e . # in an environment that has vLLM
205
+ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
206
+ ```
207
+
208
+ ### Usage
209
+
210
+ - **Web page**: open `http://SERVER:8080/`, pick a direction, click "Start microphone", or choose an audio file ("Play in real time" translates while playing). Browsers allow the microphone only on HTTPS or localhost; the simplest way for a remote server is SSH port forwarding: `ssh -N -L 8080:127.0.0.1:8080 user@server`, then open `http://127.0.0.1:8080/`.
211
+ - **Command-line client**:
212
+
213
+ ```bash
214
+ python -m simulst.client audio.wav --direction en2zh --url http://127.0.0.1:8080 # as fast as possible
215
+ python -m simulst.client audio.wav --direction zh2en --url http://127.0.0.1:8080 --realtime # real-time streaming
216
+ ```
217
+
218
+ - **File upload with streamed results (SSE)**:
219
+
220
+ ```bash
221
+ curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
222
+ ```
223
+
224
+ - **Real-time WebSocket**: connect to `ws://SERVER:8080/translate/ws`, send `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`, wait for `ready`, send binary PCM audio, send `{"eof":true}` at the end and read events until `done`. See [deployment guide · API](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT.md#api).
225
+
226
+ ### llama.cpp (GGUF)
227
+
228
+ The GGUF version runs on llama.cpp (Q8_0 30.3 GiB / Q4_K_M 17.3 GiB, plus a 1.2 GiB audio encoder) with the same streaming logic and repetition guard as the vLLM version.
229
+
230
+ **To match the vLLM version, llama.cpp needs an audio patch** ([patches/llama.cpp](https://github.com/TimeKettle/Babelfish/tree/main/patches/llama.cpp)): llama.cpp pads the last partial second of audio and encodes the padding, so the model believes it has heard more audio than it has and speaks too early. With the patch, Q8_0 is on par with vLLM (FLEURS English → Chinese COMET 88.8 vs 88.9); without it the model still runs, with COMET about 1.4 lower and output about 0.65 s earlier.
231
+
232
+ ```bash
233
+ # build llama.cpp with the patch
234
+ git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
235
+ git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # path when cloned inside the Babelfish repository
236
+ cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
237
+ # start llama-server and the web / API service (same APIs as the vLLM version)
238
+ bash scripts/deploy_llamacpp.sh --model TimeKettle/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
239
+ ```
240
+
241
+ Greedy decoding with the repetition guard is the default. Beam search also works on llama.cpp (`--beams 2`), but it was not better than greedy there and doubles the step time, so it is not the default. llama.cpp does not batch the audio prefill of several sessions, so on an A800 a step with a 24 s window takes about 0.5 s (more than the 0.32 s cadence): real-time sessions on long audio merge blocks and fall behind, which makes this version a better fit for offline jobs, short utterances and environments without vLLM. Details: [deployment guide · llama.cpp](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT.md#7-llamacpp-gguf-version).
242
+
243
+ ### Offline batch inference and evaluation
244
+
245
+ Translate a batch of audio files in streaming mode (each output has the translation and the time every character was output); manifest format in the [deployment guide · offline batch inference](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT.md#8-offline-batch-inference):
246
+
247
+ ```bash
248
+ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
249
+ ```
250
+
251
+ To reproduce the COMET, BLEU and latency results above, decode with beam size 2 and score:
252
+
253
+ ```bash
254
+ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --manifests fleurs=fleurs_en2zh.jsonl --out outputs/
255
+ python -m simulst.eval.score_sentences outputs/fleurs
256
+ ```
257
+
258
+ Test-set preparation, long-form scoring and the full results: [docs/EVALUATION.md](https://github.com/TimeKettle/Babelfish/blob/main/docs/EVALUATION.md).
259
 
260
  ## License
261
 
262
+ Code and model weights are released under the [Apache License 2.0](LICENSE). The model is fine-tuned from Qwen3-Omni-30B-A3B-Instruct (Apache License 2.0); see [NOTICE](NOTICE).
263
 
264
  ## Contributors
265
 
 
277
  url = {https://github.com/TimeKettle/Babelfish}
278
  }
279
  ```
280
+
281
+ ## Contact
282
+
283
+ Please use GitHub Issues for questions and feedback.
README_zh.md CHANGED
@@ -6,54 +6,49 @@
6
 
7
  <div align="center">
8
 
9
- [![在线体验](https://img.shields.io/badge/🤗%20Spaces-在线体验-ff9d00)](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT)
 
10
  [![GitHub](https://img.shields.io/badge/GitHub-Babelfish-181717?logo=github)](https://github.com/TimeKettle/Babelfish)
11
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)
12
 
13
  </div>
14
 
15
- > **私有预发布仓库**:包含 **Babelfish-30B-A3B** FP16 权重(音频编码器 + 语言模型,13 个 safetensors 分片,58 GiB)。在线体验 Space 挂载[锁定提交 `3aa641f`](https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/tree/3aa641fb111261acbc8bbfddb793a2c3b3f57b48);FP8(30 GiB)与 GGUF(Q8_0 / Q4_K_M)版本待正式公开发布时上线。
16
-
17
- ## 在线体验与样例试听
18
-
19
- [**打开在线体验 ↗**](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT)
20
-
21
- 在体验页中点击 **Record** 说话,结束后点击 **Stop**,出现 **Ready** 后选择翻译方向并点击 **Translate**;也可直接上传音频文件或选用下方示例。访问私有版需登录具备权限的 Hugging Face 账号。
22
-
23
- ### 中文 → 英文
24
-
25
- <audio controls preload="metadata" src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/examples/zh_birds_and_dinosaurs.wav"></audio>
26
-
27
- **中文原音** 但鸟类还是有很多地方跟恐龙相似。
28
-
29
- **模型译文** But birds still have many similarities to dinosaurs.
30
-
31
- 这段 3.84 秒录音在 **1.28 秒** 处输出 “But”,在 **1.60 秒** 处输出 “But birds”。
32
-
33
- ### 英文 → 中文
34
-
35
- <audio controls preload="metadata" src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/examples/en_birds.wav"></audio>
36
 
37
- **英文原音** Many people don't think about them as dinosaurs because they have feathers and can fly.
38
 
39
- **模型译文** “很多人不会把它们视为恐龙,因为它们有羽毛且能飞。”
40
 
41
- 这段 4.32 秒录音在 **1.28 秒** 处输出首批译文。上述时间均指源音频进度位置,在线请求实际耗时还包含上传、排队与推理时间。
42
 
43
- 样音来自 Google FLEURS(CC BY 4.0),中文样音经去头尾、提升 5 dB 并通过 Chrome 录音组件录制。[录音 ID 与署名说明](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT/blob/main/README.md#example-recordings) · [FLEURS](https://huggingface.co/datasets/google/fleurs) · [音频许可](https://creativecommons.org/licenses/by/4.0/)
 
 
44
 
45
- ## 模型介绍
46
 
47
- **Babelfish**(**Babelfish-30B-A3B**)是一个端到端的语音到文字同声传译模型,支持**英文 → 中文**与**中文 → 英文**两个方向。模型按 320 ms 一块持续接收 16 kHz 单声道音频,每块结束后自主决定继续输出译文或等待更多语音,已输出的译文不再修改。
48
 
49
- 模型由 [Qwen3-Omni-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct) 流式微调得到(仅保留 Thinker 的音频编码器与 30B-A3B MoE 语言模型,每个 token 约激活 3B 参数,已移除 Talker、Code2Wav 与视觉编码器),无需 VAD、启发式阈值或独立的读/写策略模块。方法与训练细节见技术��告(链接待补)。
50
 
51
  ## 效果
52
 
53
  我们在 Hy-SimulMT 公布的全部测试集(FLEURS、CoVoST 2、ACL 60/60、RealSI 单句、RealSI 长音频)加上 MCIF 长音频,共 11 个测试集上,对比了开源的 Hy-SimulMT 和四家商业同传服务。
54
 
55
  - **质量**:COMET 在 11 个测试集中有 10 个最高,CometKiwi 有 9 个最高;平均 COMET 英→中 85.5、中→英 80.9,次高的 Qwen3.8-LiveTranslate 为 84.3 和 79.7。唯一没有拿到最高 COMET 的是中→英 RealSI 长音频,比 Seed LiveInterpret 2.0 低 0.2。
56
- - **对比 Hy-SimulMT**:COMET 在全部 11 个测试集上都更高,英→中平均高 2.9、中→英平均高 2.3;延迟在其中 7 个测试集上更低。
57
  - **延迟**:LAAL 英→中 1.50–1.92 秒、中→英 1.97–2.15 秒,平均 1.74 秒和 2.08 秒。
58
 
59
  COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值加粗(延迟取最低);† 为商业同传服务,延迟测法不同,见表下说明。
@@ -137,23 +132,117 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
137
 
138
  </details>
139
 
140
- ## 模型版本
 
 
 
 
 
 
141
 
142
- | 版本 | 权重大小 | 显存 | 质量 | 状态 |
143
  |---|---|---|---|---|
144
- | **Babelfish-30B-A3B(FP16)** | 58 GiB(13 个分片) | 80 GB × 1,或 48 GB × 2 | 报告成绩所用版本 | 已上传至本私有仓库([锁定权重](https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/tree/3aa641fb111261acbc8bbfddb793a2c3b3f57b48)) |
145
- | **Babelfish-30B-A3B-FP8** | 30 GiB(7 个分片) | 48 GB × 1 | 11 个测试集 COMET 平均低 0.09(百分制) | 待正式公开发布 |
146
- | **Babelfish-30B-A3B-GGUF** | Q8_0 30.3 GiB / Q4_K_M 17.3 GiB + 1.2 GiB 音频编码器 | 约 36 / 23 GB | 打上 llama.cpp 音频补丁后与 vLLM 持平 | 待正式公开发布 |
 
 
 
 
 
 
147
 
148
- ## 在线体验与推理说明
 
 
149
 
150
- - **流式窗口**:按 320 ms 步长输入 16 kHz 单声道音频,保留最近 24 秒音频窗口及最多 256 个已提交译文 token 作为前文;音频结束时附带 `[audio complete]` 标记完成收尾。
151
- - **在线 Space 与批量评测差异**:[体验页](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT) 沿用技术报告中与混元及商业引擎对比的解码配置(束宽 2、关闭复读保护、关闭 n-gram 屏蔽、关闭 VAD)。技术报告使用 vLLM 批量离线评测,Space 在 ZeroGPU 上使用 Transformers 计算候选 token 分数并复用发布版束搜索与窗口策略;硬件、数值内核和拼批差异可能导致相近候选词存在细微措辞差别。[体验页源码与样音](https://huggingface.co/spaces/dengshiyang2003/Babelfish-SimulMT/tree/main)
152
- - **自托管推理服务**:配套开源代码仓库([GitHub](https://github.com/TimeKettle/Babelfish))提供 vLLM 与 llama.cpp 部署脚本、实时 WebSocket 接口、文件上传 SSE 接口与离线评测脚本(默认贪心解码 + 轻量复读保护,加 `--beams 2` 可复现报告成绩)。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
  ## 许可证
155
 
156
- Apache License 2.0(见 [LICENSE](LICENSE))。模型由 Qwen3-Omni-30B-A3B-Instruct(Apache License 2.0)微调得到,见 [NOTICE](NOTICE)。
157
 
158
  ## 贡献者
159
 
@@ -171,3 +260,7 @@ Apache License 2.0(见 [LICENSE](LICENSE))。模型由 Qwen3-Omni-30B-A3B-In
171
  url = {https://github.com/TimeKettle/Babelfish}
172
  }
173
  ```
 
 
 
 
 
6
 
7
  <div align="center">
8
 
9
+ [![Hugging Face](https://img.shields.io/badge/Hugging%20Face-Babelfish-ffc107)](https://huggingface.co/TimeKettle)
10
+ [![ModelScope](https://img.shields.io/badge/ModelScope-Babelfish-624aff)](https://www.modelscope.cn/organization/TimeKettle)
11
  [![GitHub](https://img.shields.io/badge/GitHub-Babelfish-181717?logo=github)](https://github.com/TimeKettle/Babelfish)
12
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)
13
 
14
  </div>
15
 
16
+ <!-- 演示视频原文件备份在 assets/demo_en2zh.mp4 和 assets/demo_zh2en.mp4 -->
17
+ <div align="center">
18
+ <table>
19
+ <tr>
20
+ <td align="center"><b>英文 → 中文</b></td>
21
+ <td align="center"><b>中文 → 英文</b></td>
22
+ </tr>
23
+ <tr>
24
+ <td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/assets/demo_en2zh.mp4" width="380" controls></video></td>
25
+ <td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulMT/resolve/main/assets/demo_zh2en.mp4" width="380" controls></video></td>
26
+ </tr>
27
+ </table>
28
+ <sub>演示中的译文由本仓库开源的 Babelfish-30B-A3B 实时生成(束宽 2)。<br>界面上的原文转写与译文语音由另接的语音识别和语音合成模型生成,不在本次开源范围内。</sub>
29
+ </div>
 
 
 
 
 
 
 
30
 
31
+ ## 模型介绍
32
 
33
+ **Babelfish-30B-A3B** 是一个语音到文字的同声传译模型,支持**英文 → 中文**和**中文 → 英文**两个方向:说话人的声音持续输入,模型边听边译,已经输出的译文不再修改。模型由 Qwen3-Omni-30B-A3B-Instruct 流式微调得到(MoE 结构,每个 token 约激活 3B 参数),方法与训练细节见技术报告(链接待补)。
34
 
35
+ 本仓库开源:
36
 
37
+ - 模型权重:FP16 原版、FP8 量化版(vLLM)、GGUF 量化版(llama.cpp);
38
+ - 推理与部署代码:网页(麦克风 / 上传文件)、实时 WebSocket 接口、文件上传接口、命令行客户端、一键部署脚本;
39
+ - 离线批量推理与评测脚本。
40
 
41
+ 训练代码和训练数据构造暂不开源。
42
 
43
+ ## 新闻
44
 
45
+ - **2026.11.XX|发布**:Babelfish-30B-A3B 及其 FP8、GGUF 量化版发布,推理与部署代码同步开源;技术报告(链接待补)。
46
 
47
  ## 效果
48
 
49
  我们在 Hy-SimulMT 公布的全部测试集(FLEURS、CoVoST 2、ACL 60/60、RealSI 单句、RealSI 长音频)加上 MCIF 长音频,共 11 个测试集上,对比了开源的 Hy-SimulMT 和四家商业同传服务。
50
 
51
  - **质量**:COMET 在 11 个测试集中有 10 个最高,CometKiwi 有 9 个最高;平均 COMET 英→中 85.5、中→英 80.9,次高的 Qwen3.8-LiveTranslate 为 84.3 和 79.7。唯一没有拿到最高 COMET 的是中→英 RealSI 长音频,比 Seed LiveInterpret 2.0 低 0.2。
 
52
  - **延迟**:LAAL 英→中 1.50–1.92 秒、中→英 1.97–2.15 秒,平均 1.74 秒和 2.08 秒。
53
 
54
  COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值加粗(延迟取最低);† 为商业同传服务,延迟测法不同,见表下说明。
 
132
 
133
  </details>
134
 
135
+ ## 模型链接
136
+
137
+ | 模型名 | 简介 | 推理框架 | 下载 |
138
+ |---|---|---|---|
139
+ | Babelfish-30B-A3B | FP16 原版 | vLLM | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B) |
140
+ | Babelfish-30B-A3B-FP8 | FP8 量化(逐 128×128 块缩放) | vLLM | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B-FP8) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B-FP8) |
141
+ | Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + 音频编码器 | llama.cpp | [Hugging Face](https://huggingface.co/TimeKettle/Babelfish-30B-A3B-GGUF) · [ModelScope](https://www.modelscope.cn/models/TimeKettle/Babelfish-30B-A3B-GGUF) |
142
 
143
+ | 版本 | 权重大小 | 显存 | 质量 | 适合 |
144
  |---|---|---|---|---|
145
+ | FP16 | 58 GiB | 80 GB × 1,或 48 GB × 2 | 发布成绩所用版本 | 服务器部署 |
146
+ | FP8 | 30 GiB | 48 GB × 1 | 11 个测试集 COMET 平均低 0.09(百分制) | 单张 48 GB 卡;H100 / H20 / L40S 原生 FP8 |
147
+ | GGUF Q8_0 / Q4_K_M | 30.3 / 17.3 GiB + 1.2 GiB 音频编码器 | 约 36 / 23 GB | 打上 llama.cpp 音频补丁后与 vLLM 持平 | llama.cpp;没有 vLLM 的环境、离线转写 |
148
+
149
+ ## 部署推理服务
150
+
151
+ > 详细说明(环境、显存、多卡、HTTPS、接口协议、常见问题)见 **[部署教程](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT_zh.md)**。
152
+
153
+ ### 环境要求
154
 
155
+ - Linux,Python 3.10 及以上,NVIDIA GPU:FP16 版需要 1 张 80 GB 显卡(或 2 张 48 GB 做张量并行),FP8 版需要 48 GB 及以上显存;
156
+ - vLLM(已测试 0.28.0 和 0.23 nightly,配 transformers 5.13.1);
157
+ - llama.cpp 部署 GGUF 版的要求见下文。
158
 
159
+ ### 一键部署(vLLM)
160
+
161
+ ```bash
162
+ git clone https://github.com/TimeKettle/Babelfish.git
163
+ cd Babelfish
164
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B
165
+ ```
166
+
167
+ 命令会在 `.simulst/env` 新建环境��安装 vLLM 和本项目、下载模型、启动服务。看到 `Ready: http://127.0.0.1:8080/` 后即可使用,按 Ctrl+C 停止。
168
+
169
+ 常用写法:
170
+
171
+ ```bash
172
+ # 从 ModelScope 下载
173
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B --source modelscope
174
+ # 显卡驱动只支持到 CUDA 12.x:安装 CUDA 12.9 构建的 vLLM / torch
175
+ bash scripts/deploy.sh --install --cu129 --model TimeKettle/Babelfish-30B-A3B
176
+ # 已有 vLLM 环境、模型已在本地
177
+ bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
178
+ # FP8 版
179
+ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B-FP8
180
+ # 两张卡张量并行
181
+ bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
182
+ ```
183
+
184
+ 也可以不用脚本,直接启动服务:
185
+
186
+ ```bash
187
+ pip install -e . # 在已装好 vLLM 的环境里
188
+ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
189
+ ```
190
+
191
+ ### 使用
192
+
193
+ - **网页**:浏览器打开 `http://服务器地址:8080/`,选择方向,点“开始麦克风”说话,或选择音频文件(可勾选“按实时速度播放”边播边译)。远程使用麦克风需要 HTTPS 或 localhost,最简单的做法是 SSH 端口转发:`ssh -N -L 8080:127.0.0.1:8080 user@server`,再打开 `http://127.0.0.1:8080/`。
194
+ - **命令行客户端**:
195
+
196
+ ```bash
197
+ python -m simulst.client audio.wav --direction en2zh --url http://127.0.0.1:8080 # 尽快解完
198
+ python -m simulst.client audio.wav --direction zh2en --url http://127.0.0.1:8080 --realtime # 按实时速度推流
199
+ ```
200
+
201
+ - **上传文件(SSE 流式返回)**:
202
+
203
+ ```bash
204
+ curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
205
+ ```
206
+
207
+ - **实时 WebSocket**:连接 `ws://服务器地址:8080/translate/ws`,先发 `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`,收到 `ready` 后发送 PCM 二进制音频,结束时发 `{"eof":true}`,一直接收到 `done`。协议见 [部署教程 · 接口](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT_zh.md#接口)。
208
+
209
+ ### llama.cpp(GGUF)
210
+
211
+ GGUF 版用 llama.cpp 运行(Q8_0 30.3 GiB / Q4_K_M 17.3 GiB,外加 1.2 GiB 的音频编码器),推理逻辑和复读保护与 vLLM 版相同。
212
+
213
+ **要达到 vLLM 版的质量,需要给 llama.cpp 打一个音频补丁**([patches/llama.cpp](https://github.com/TimeKettle/Babelfish/tree/main/patches/llama.cpp)):llama.cpp 会把最后不满 1 秒的音频补零后照常编码,模型以为听到了更多音频,于是过早开口。打补丁后 Q8_0 与 vLLM 持平(FLEURS 英→中 COMET 88.8 vs 88.9);不打也能运行,但 COMET 低约 1.4、出字早约 0.65 s。
214
+
215
+ ```bash
216
+ # 编译打过补丁的 llama.cpp
217
+ git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
218
+ git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # 在 Babelfish 仓库目录下 clone 时的相对路径
219
+ cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
220
+ # 一键启动 llama-server 和网页 / 接口服务(接口与 vLLM 版相同)
221
+ bash scripts/deploy_llamacpp.sh --model TimeKettle/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
222
+ ```
223
+
224
+ 默认贪心解码 + 复读保护。llama.cpp 上也能用束搜索(`--beams 2`),但实测质量没有比贪心更好、每步耗时翻倍,所以不作为默认。llama.cpp 不会把多路音频的预填拼成一批,A800 上 24 s 窗口每步约 0.5 s(超过 0.32 s 的节拍),长音频的实时会话会合并音频块、延迟变大,更适合离线转写、短句或没有 vLLM 的环境。详见[部署教程 · llama.cpp](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT_zh.md#7-llamacppgguf-版)。
225
+
226
+ ### 离线批量推理与评测
227
+
228
+ 一批音频文件按流式方式译完(每条输出译文和每个字的输出时刻),清单格式见[部署教程 · 离线批量推理](https://github.com/TimeKettle/Babelfish/blob/main/docs/DEPLOYMENT_zh.md#8-离线批量推理):
229
+
230
+ ```bash
231
+ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
232
+ ```
233
+
234
+ 复现上文的 COMET、BLEU 和延迟:解码时用束宽 2,再打分:
235
+
236
+ ```bash
237
+ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --manifests fleurs=fleurs_en2zh.jsonl --out outputs/
238
+ python -m simulst.eval.score_sentences outputs/fleurs
239
+ ```
240
+
241
+ 测试集准备、长音频打分和完整结果见 [docs/EVALUATION_zh.md](https://github.com/TimeKettle/Babelfish/blob/main/docs/EVALUATION_zh.md)。
242
 
243
  ## 许可证
244
 
245
+ 代码与模型权重以 [Apache License 2.0](LICENSE) 发布。模型由 Qwen3-Omni-30B-A3B-Instruct(Apache License 2.0)微调得到,见 [NOTICE](NOTICE)。
246
 
247
  ## 贡献者
248
 
 
260
  url = {https://github.com/TimeKettle/Babelfish}
261
  }
262
  ```
263
+
264
+ ## 联系我们
265
+
266
+ 欢迎通过 GitHub Issues 反馈问题和建议。