Audio-Text-to-Text
Safetensors
GGUF
English
Chinese
simultaneous-translation
speech-translation
streaming
qwen3-omni
vllm
fp8
llama.cpp
conversational
Instructions to use timekettle/Babelfish-SimulST with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use timekettle/Babelfish-SimulST with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M # Run inference directly in the terminal: llama cli -hf timekettle/Babelfish-SimulST:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M # Run inference directly in the terminal: llama cli -hf timekettle/Babelfish-SimulST:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf timekettle/Babelfish-SimulST:Q4_K_M
Use Docker
docker model run hf.co/timekettle/Babelfish-SimulST:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use timekettle/Babelfish-SimulST with Ollama:
ollama run hf.co/timekettle/Babelfish-SimulST:Q4_K_M
- Unsloth Desktop
- Pi
How to use timekettle/Babelfish-SimulST with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "timekettle/Babelfish-SimulST:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use timekettle/Babelfish-SimulST with Docker Model Runner:
docker model run hf.co/timekettle/Babelfish-SimulST:Q4_K_M
- Lemonade
How to use timekettle/Babelfish-SimulST with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull timekettle/Babelfish-SimulST:Q4_K_M
Run and chat with the model
lemonade run user.Babelfish-SimulST-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use timekettle/Babelfish-SimulST with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default timekettle/Babelfish-SimulST:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use timekettle/Babelfish-SimulST with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf timekettle/Babelfish-SimulST:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "timekettle/Babelfish-SimulST:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Sync README with GitHub and host demo videos
Browse files- README.md +134 -41
- 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
|
| 23 |
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
-
[](https://github.com/TimeKettle/Babelfish)
|
| 28 |
[](LICENSE)
|
| 29 |
|
| 30 |
</div>
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<
|
| 43 |
-
|
| 44 |
-
|
| 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 |
-
|
| 55 |
|
| 56 |
-
**
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
-
| Version | Weights | GPU memory | Quality |
|
| 160 |
|---|---|---|---|---|
|
| 161 |
-
|
|
| 162 |
-
|
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
-
|
|
|
|
|
|
|
| 166 |
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
## License
|
| 172 |
|
| 173 |
-
Apache License 2.0
|
| 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 |
+
[](https://huggingface.co/TimeKettle)
|
| 27 |
+
[](https://www.modelscope.cn/organization/TimeKettle)
|
| 28 |
[](https://github.com/TimeKettle/Babelfish)
|
| 29 |
[](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://github.com/TimeKettle/Babelfish)
|
| 11 |
[](LICENSE)
|
| 12 |
|
| 13 |
</div>
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
<
|
| 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 |
-
|
| 38 |
|
| 39 |
-
**模型
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
|
| 49 |
-
|
| 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 |
-
|
|
| 145 |
-
|
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
## 许可证
|
| 155 |
|
| 156 |
-
Apache License 2.0
|
| 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 |
+
[](https://huggingface.co/TimeKettle)
|
| 10 |
+
[](https://www.modelscope.cn/organization/TimeKettle)
|
| 11 |
[](https://github.com/TimeKettle/Babelfish)
|
| 12 |
[](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 反馈问题和建议。
|