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"
dengshiyang2003 commited on
Commit ·
f2ff1ea
1
Parent(s): dc8a907
Rename Babelfish-SimulMT to Babelfish-SimulST in model card
Browse files- README.md +23 -23
- README_zh.md +23 -23
README.md
CHANGED
|
@@ -23,8 +23,8 @@ tags:
|
|
| 23 |
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
-
[](https://huggingface.co/timekettle/Babelfish-
|
| 27 |
-
[](https://github.com/timekettle/Babelfish-
|
| 28 |
[](LICENSE)
|
| 29 |
|
| 30 |
</div>
|
|
@@ -37,8 +37,8 @@ tags:
|
|
| 37 |
<td align="center"><b>Chinese → English</b></td>
|
| 38 |
</tr>
|
| 39 |
<tr>
|
| 40 |
-
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-
|
| 41 |
-
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-
|
| 42 |
</tr>
|
| 43 |
</table>
|
| 44 |
<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>
|
|
@@ -141,10 +141,10 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
|
|
| 141 |
- **COMET**: wmt22-comet-da; **CometKiwi**: wmt22-cometkiwi-da (reference-free); **BLEU**: SacreBLEU (zh tokenizer for Chinese output, 13a for English). The raw output is scored (punctuation kept); sentence-level sets are scored per sentence; long-form sets (MCIF, RealSI long-form) are first re-segmented to the official reference sentences with OmniSTEval.
|
| 142 |
- **Latency**: LAAL for sentence-level sets, StreamLAAL (LAAL after re-segmentation) for long-form sets; characters for Chinese output, words for English output.
|
| 143 |
- **The two groups of latencies are measured differently and are not directly comparable**: Babelfish and Hy-SimulMT are simulated offline on the audio timeline, without computation time; the commercial services were fed audio in real time and their latency is the wall-clock time at which the text arrived, including network round trips and server-side computation.
|
| 144 |
-
- Babelfish results use beam size 2 (`--beams 2`); the released default is greedy decoding with the repetition guard, of comparable quality (slightly higher on FLEURS, 0.5 lower on MCIF; see [deployment guide 3.3](https://github.com/timekettle/Babelfish-
|
| 145 |
- \* Approximate: GPT-Realtime-Translate produced valid results for only part of CoVoST 2; the values measured on those sentences are extrapolated to the full set with the average difference of the other systems (about ±0.5 COMET).
|
| 146 |
- Test set sizes: MCIF 21 talks; RealSI long-form 10 recordings per direction; FLEURS 646 / 945 sentences; CoVoST 2 15,530 / 4,898; ACL 60/60 dev 468, eval 416; RealSI sentences 346 / 431.
|
| 147 |
-
- Raw scores on a 0–1 scale, quantized versions and decoding settings: [docs/EVALUATION.md](https://github.com/timekettle/Babelfish-
|
| 148 |
|
| 149 |
</details>
|
| 150 |
|
|
@@ -152,9 +152,9 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
|
|
| 152 |
|
| 153 |
| Model | Description | Framework | Download |
|
| 154 |
|---|---|---|---|
|
| 155 |
-
| Babelfish-30B-A3B | original FP16 model | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 156 |
-
| Babelfish-30B-A3B-FP8 | FP8 (one scale per 128×128 block) | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 157 |
-
| Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + audio encoder | llama.cpp | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 158 |
|
| 159 |
| Version | Weights | GPU memory | Quality | Use |
|
| 160 |
|---|---|---|---|---|
|
|
@@ -164,7 +164,7 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
|
|
| 164 |
|
| 165 |
## Deployment
|
| 166 |
|
| 167 |
-
> Details (environment, GPU memory, multi-GPU, HTTPS, API protocol, FAQ) are in the **[deployment guide](https://github.com/timekettle/Babelfish-
|
| 168 |
|
| 169 |
### Requirements
|
| 170 |
|
|
@@ -177,8 +177,8 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
|
|
| 177 |
Create and activate a conda environment, then install the dependencies:
|
| 178 |
|
| 179 |
```bash
|
| 180 |
-
git clone https://github.com/timekettle/Babelfish-
|
| 181 |
-
cd Babelfish-
|
| 182 |
|
| 183 |
conda create -n babelfish python=3.12 -y
|
| 184 |
conda activate babelfish
|
|
@@ -197,9 +197,9 @@ With the `babelfish` environment active, start the server (passing a model ID do
|
|
| 197 |
|
| 198 |
```bash
|
| 199 |
# download from Hugging Face and start (FP16)
|
| 200 |
-
bash scripts/deploy.sh --model timekettle/Babelfish-
|
| 201 |
# FP8 version
|
| 202 |
-
bash scripts/deploy.sh --model timekettle/Babelfish-
|
| 203 |
# local model, single GPU or tensor parallelism over two GPUs
|
| 204 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 205 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
@@ -208,7 +208,7 @@ bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
| 208 |
You can also pass `--install` to let the script create and set up the `babelfish` conda environment automatically (add `--cu129` for CUDA 12.x drivers):
|
| 209 |
|
| 210 |
```bash
|
| 211 |
-
bash scripts/deploy.sh --install --model timekettle/Babelfish-
|
| 212 |
```
|
| 213 |
|
| 214 |
Or start the server directly inside the `babelfish` conda environment:
|
|
@@ -233,28 +233,28 @@ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
|
|
| 233 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 234 |
```
|
| 235 |
|
| 236 |
-
- **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-
|
| 237 |
|
| 238 |
### llama.cpp (GGUF)
|
| 239 |
|
| 240 |
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.
|
| 241 |
|
| 242 |
-
**To match the vLLM version, llama.cpp needs an audio patch** ([patches/llama.cpp](https://github.com/timekettle/Babelfish-
|
| 243 |
|
| 244 |
```bash
|
| 245 |
# build llama.cpp with the patch
|
| 246 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 247 |
-
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # path when cloned inside the Babelfish-
|
| 248 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 249 |
# start llama-server and the web / API service (same APIs as the vLLM version)
|
| 250 |
-
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-
|
| 251 |
```
|
| 252 |
|
| 253 |
-
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-
|
| 254 |
|
| 255 |
### Offline batch inference and evaluation
|
| 256 |
|
| 257 |
-
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-
|
| 258 |
|
| 259 |
```bash
|
| 260 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
@@ -267,7 +267,7 @@ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --ma
|
|
| 267 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 268 |
```
|
| 269 |
|
| 270 |
-
Test-set preparation, long-form scoring and the full results: [docs/EVALUATION.md](https://github.com/timekettle/Babelfish-
|
| 271 |
|
| 272 |
## License
|
| 273 |
|
|
@@ -286,7 +286,7 @@ If Babelfish helps your work, please cite:
|
|
| 286 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 287 |
author = {Shiyang Deng and Nanjie Li and Xiaoyong Guo and Haihua Xu and Wei Shi and Hao Huang and Xiansu Deng and Jun Guo and Yuanming Luo and Wangzheng Wu},
|
| 288 |
year = {2026},
|
| 289 |
-
url = {https://github.com/timekettle/Babelfish-
|
| 290 |
}
|
| 291 |
```
|
| 292 |
|
|
|
|
| 23 |
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
+
[](https://huggingface.co/timekettle/Babelfish-SimulST)
|
| 27 |
+
[](https://github.com/timekettle/Babelfish-SimulST)
|
| 28 |
[](LICENSE)
|
| 29 |
|
| 30 |
</div>
|
|
|
|
| 37 |
<td align="center"><b>Chinese → English</b></td>
|
| 38 |
</tr>
|
| 39 |
<tr>
|
| 40 |
+
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulST/resolve/main/assets/demo_en2zh.mp4" width="380" controls></video></td>
|
| 41 |
+
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulST/resolve/main/assets/demo_zh2en.mp4" width="380" controls></video></td>
|
| 42 |
</tr>
|
| 43 |
</table>
|
| 44 |
<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>
|
|
|
|
| 141 |
- **COMET**: wmt22-comet-da; **CometKiwi**: wmt22-cometkiwi-da (reference-free); **BLEU**: SacreBLEU (zh tokenizer for Chinese output, 13a for English). The raw output is scored (punctuation kept); sentence-level sets are scored per sentence; long-form sets (MCIF, RealSI long-form) are first re-segmented to the official reference sentences with OmniSTEval.
|
| 142 |
- **Latency**: LAAL for sentence-level sets, StreamLAAL (LAAL after re-segmentation) for long-form sets; characters for Chinese output, words for English output.
|
| 143 |
- **The two groups of latencies are measured differently and are not directly comparable**: Babelfish and Hy-SimulMT are simulated offline on the audio timeline, without computation time; the commercial services were fed audio in real time and their latency is the wall-clock time at which the text arrived, including network round trips and server-side computation.
|
| 144 |
+
- Babelfish results use beam size 2 (`--beams 2`); the released default is greedy decoding with the repetition guard, of comparable quality (slightly higher on FLEURS, 0.5 lower on MCIF; see [deployment guide 3.3](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT.md#33-decoding-greedy-or-beam-size-2)). Hy-SimulMT-30B-A3B uses the official SimulInfer defaults (1.6 s chunks, VAD on).
|
| 145 |
- \* Approximate: GPT-Realtime-Translate produced valid results for only part of CoVoST 2; the values measured on those sentences are extrapolated to the full set with the average difference of the other systems (about ±0.5 COMET).
|
| 146 |
- Test set sizes: MCIF 21 talks; RealSI long-form 10 recordings per direction; FLEURS 646 / 945 sentences; CoVoST 2 15,530 / 4,898; ACL 60/60 dev 468, eval 416; RealSI sentences 346 / 431.
|
| 147 |
+
- Raw scores on a 0–1 scale, quantized versions and decoding settings: [docs/EVALUATION.md](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/EVALUATION.md).
|
| 148 |
|
| 149 |
</details>
|
| 150 |
|
|
|
|
| 152 |
|
| 153 |
| Model | Description | Framework | Download |
|
| 154 |
|---|---|---|---|
|
| 155 |
+
| Babelfish-30B-A3B | original FP16 model | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B) |
|
| 156 |
+
| Babelfish-30B-A3B-FP8 | FP8 (one scale per 128×128 block) | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B-FP8) |
|
| 157 |
+
| Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + audio encoder | llama.cpp | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B-GGUF) |
|
| 158 |
|
| 159 |
| Version | Weights | GPU memory | Quality | Use |
|
| 160 |
|---|---|---|---|---|
|
|
|
|
| 164 |
|
| 165 |
## Deployment
|
| 166 |
|
| 167 |
+
> Details (environment, GPU memory, multi-GPU, HTTPS, API protocol, FAQ) are in the **[deployment guide](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT.md)**.
|
| 168 |
|
| 169 |
### Requirements
|
| 170 |
|
|
|
|
| 177 |
Create and activate a conda environment, then install the dependencies:
|
| 178 |
|
| 179 |
```bash
|
| 180 |
+
git clone https://github.com/timekettle/Babelfish-SimulST.git
|
| 181 |
+
cd Babelfish-SimulST
|
| 182 |
|
| 183 |
conda create -n babelfish python=3.12 -y
|
| 184 |
conda activate babelfish
|
|
|
|
| 197 |
|
| 198 |
```bash
|
| 199 |
# download from Hugging Face and start (FP16)
|
| 200 |
+
bash scripts/deploy.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B
|
| 201 |
# FP8 version
|
| 202 |
+
bash scripts/deploy.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B-FP8
|
| 203 |
# local model, single GPU or tensor parallelism over two GPUs
|
| 204 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 205 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
|
|
| 208 |
You can also pass `--install` to let the script create and set up the `babelfish` conda environment automatically (add `--cu129` for CUDA 12.x drivers):
|
| 209 |
|
| 210 |
```bash
|
| 211 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B
|
| 212 |
```
|
| 213 |
|
| 214 |
Or start the server directly inside the `babelfish` conda environment:
|
|
|
|
| 233 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 234 |
```
|
| 235 |
|
| 236 |
+
- **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-SimulST/blob/main/docs/DEPLOYMENT.md#api).
|
| 237 |
|
| 238 |
### llama.cpp (GGUF)
|
| 239 |
|
| 240 |
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.
|
| 241 |
|
| 242 |
+
**To match the vLLM version, llama.cpp needs an audio patch** ([patches/llama.cpp](https://github.com/timekettle/Babelfish-SimulST/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.
|
| 243 |
|
| 244 |
```bash
|
| 245 |
# build llama.cpp with the patch
|
| 246 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 247 |
+
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # path when cloned inside the Babelfish-SimulST repository
|
| 248 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 249 |
# start llama-server and the web / API service (same APIs as the vLLM version)
|
| 250 |
+
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
|
| 251 |
```
|
| 252 |
|
| 253 |
+
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-SimulST/blob/main/docs/DEPLOYMENT.md#7-llamacpp-gguf-version).
|
| 254 |
|
| 255 |
### Offline batch inference and evaluation
|
| 256 |
|
| 257 |
+
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-SimulST/blob/main/docs/DEPLOYMENT.md#8-offline-batch-inference):
|
| 258 |
|
| 259 |
```bash
|
| 260 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
|
|
| 267 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 268 |
```
|
| 269 |
|
| 270 |
+
Test-set preparation, long-form scoring and the full results: [docs/EVALUATION.md](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/EVALUATION.md).
|
| 271 |
|
| 272 |
## License
|
| 273 |
|
|
|
|
| 286 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 287 |
author = {Shiyang Deng and Nanjie Li and Xiaoyong Guo and Haihua Xu and Wei Shi and Hao Huang and Xiansu Deng and Jun Guo and Yuanming Luo and Wangzheng Wu},
|
| 288 |
year = {2026},
|
| 289 |
+
url = {https://github.com/timekettle/Babelfish-SimulST}
|
| 290 |
}
|
| 291 |
```
|
| 292 |
|
README_zh.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
| 6 |
|
| 7 |
<div align="center">
|
| 8 |
|
| 9 |
-
[](https://huggingface.co/timekettle/Babelfish-
|
| 10 |
-
[](https://github.com/timekettle/Babelfish-
|
| 11 |
[](LICENSE)
|
| 12 |
|
| 13 |
</div>
|
|
@@ -20,8 +20,8 @@
|
|
| 20 |
<td align="center"><b>中文 → 英文</b></td>
|
| 21 |
</tr>
|
| 22 |
<tr>
|
| 23 |
-
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-
|
| 24 |
-
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-
|
| 25 |
</tr>
|
| 26 |
</table>
|
| 27 |
<sub>演示中的译文由本仓库开源的 Babelfish-30B-A3B 实时生成(束宽 2)。<br>界面上的原文转写与译文语音由另接的语音识别和语音合成模型生成,不在本次开源范围内。</sub>
|
|
@@ -124,10 +124,10 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 124 |
- **COMET**:wmt22-comet-da;**CometKiwi**:wmt22-cometkiwi-da(不看参考译文);**BLEU**:SacreBLEU(英→中 zh 分词,中→英 13a)。译文保留标点原样打分;单句集逐句打分,长音频(MCIF、RealSI 长音频)先用 OmniSTEval 按官方句子重新切分再打分。
|
| 125 |
- **延迟**:单句集为 LAAL,长音频为重新切分后计算的 StreamLAAL;英→中按字、中→英按词计算。
|
| 126 |
- **两组延迟测法不同,不能直接比较**:Babelfish 和 Hy-SimulMT 按音频时间离线模拟,不含计算耗时;四家商业服务按实时速度送入音频,记录收到译文时的墙钟时间,包含网络往返和服务端计算。
|
| 127 |
-
- Babelfish 的成绩用束宽 2 解码(`--beams 2`);发布版默认改为贪心解码 + 复读保护,质量相当(FLEURS 略高、MCIF 低 0.5),见[部署教程 3.3](https://github.com/timekettle/Babelfish-
|
| 128 |
- 带 * 的格子为近似值:GPT-Realtime-Translate 在 CoVoST 2 上只有部分句子有有效结果,按其余系统在同一批句子上的差值推算到全集(COMET 误差约 ±0.5)。
|
| 129 |
- 测试集规模:MCIF 21 段、RealSI 长音频每个方向 10 段、FLEURS 646 / 945 句、CoVoST 2 15,530 / 4,898 句、ACL 60/60 dev 468 句、eval 416 句、RealSI 单句 346 / 431 句。
|
| 130 |
-
- 0–1 分制的原始分数、量化版和不同解码方式的对比见 [docs/EVALUATION_zh.md](https://github.com/timekettle/Babelfish-
|
| 131 |
|
| 132 |
</details>
|
| 133 |
|
|
@@ -135,9 +135,9 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 135 |
|
| 136 |
| 模型名 | 简介 | 推理框架 | 下载 |
|
| 137 |
|---|---|---|---|
|
| 138 |
-
| Babelfish-30B-A3B | FP16 原版 | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 139 |
-
| Babelfish-30B-A3B-FP8 | FP8 量化(逐 128×128 块缩放) | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 140 |
-
| Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + 音频编码器 | llama.cpp | [Hugging Face](https://huggingface.co/timekettle/Babelfish-
|
| 141 |
|
| 142 |
| 版本 | 权重大小 | 显存 | 质量 | 适合 |
|
| 143 |
|---|---|---|---|---|
|
|
@@ -147,7 +147,7 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 147 |
|
| 148 |
## 部署推理服务
|
| 149 |
|
| 150 |
-
> 详细说明(环境、显存、多卡、HTTPS、接口协议、常见问题)见 **[部署教程](https://github.com/timekettle/Babelfish-
|
| 151 |
|
| 152 |
### 环境要求
|
| 153 |
|
|
@@ -160,8 +160,8 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 160 |
先创建并激活 conda 环境,再安装依赖:
|
| 161 |
|
| 162 |
```bash
|
| 163 |
-
git clone https://github.com/timekettle/Babelfish-
|
| 164 |
-
cd Babelfish-
|
| 165 |
|
| 166 |
conda create -n babelfish python=3.12 -y
|
| 167 |
conda activate babelfish
|
|
@@ -180,9 +180,9 @@ pip install -e .
|
|
| 180 |
|
| 181 |
```bash
|
| 182 |
# 从 Hugging Face 下载并启动(FP16 原版)
|
| 183 |
-
bash scripts/deploy.sh --model timekettle/Babelfish-
|
| 184 |
# FP8 版
|
| 185 |
-
bash scripts/deploy.sh --model timekettle/Babelfish-
|
| 186 |
# 本地权重,指定单卡或两卡张量并行
|
| 187 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 188 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
@@ -191,7 +191,7 @@ bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
| 191 |
也可以给脚本加 `--install`,自动创建并配置名为 `babelfish` 的 conda 环境(驱动只到 CUDA 12.x 时加 `--cu129`):
|
| 192 |
|
| 193 |
```bash
|
| 194 |
-
bash scripts/deploy.sh --install --model timekettle/Babelfish-
|
| 195 |
```
|
| 196 |
|
| 197 |
或不用脚本,在 `babelfish` conda 环境里直接启动服务:
|
|
@@ -216,28 +216,28 @@ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
|
|
| 216 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 217 |
```
|
| 218 |
|
| 219 |
-
- **实时 WebSocket**:连接 `ws://服务器地址:8080/translate/ws`,先发 `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`,收到 `ready` 后发送 PCM 二进制音频,结束时发 `{"eof":true}`,一直接收到 `done`。协议见 [部署教程 · 接口](https://github.com/timekettle/Babelfish-
|
| 220 |
|
| 221 |
### llama.cpp(GGUF)
|
| 222 |
|
| 223 |
GGUF 版用 llama.cpp 运行(Q8_0 30.3 GiB / Q4_K_M 17.3 GiB,外加 1.2 GiB 的音频编码器),推理逻辑和复读保护与 vLLM 版相同。
|
| 224 |
|
| 225 |
-
**要达到 vLLM 版的质量,需要给 llama.cpp 打一个音频补丁**([patches/llama.cpp](https://github.com/timekettle/Babelfish-
|
| 226 |
|
| 227 |
```bash
|
| 228 |
# 编译打过补丁的 llama.cpp
|
| 229 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 230 |
-
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # 在 Babelfish-
|
| 231 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 232 |
# 一键启动 llama-server 和网页 / 接口服务(接口与 vLLM 版相同)
|
| 233 |
-
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-
|
| 234 |
```
|
| 235 |
|
| 236 |
-
默认贪心解码 + 复读保护。llama.cpp 上也能用束搜索(`--beams 2`),但实测质量没有比贪心更好、每步耗时翻倍,所以不作为默认。llama.cpp 不会把多路音频的预填拼成一批,A800 上 24 s 窗口每步约 0.5 s(超过 0.32 s 的节拍),长音频的实时会话会合并音频块、延迟变大,更适合离线转写、短句或没有 vLLM 的环境。详见[部署教程 · llama.cpp](https://github.com/timekettle/Babelfish-
|
| 237 |
|
| 238 |
### 离线批量推理与评测
|
| 239 |
|
| 240 |
-
一批音频文件按流式方式译完(每条输出译文和每个字的输出时刻),清单格式见[部署教程 · 离线批量推理](https://github.com/timekettle/Babelfish-
|
| 241 |
|
| 242 |
```bash
|
| 243 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
@@ -250,7 +250,7 @@ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --ma
|
|
| 250 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 251 |
```
|
| 252 |
|
| 253 |
-
测试集准备、长音频打分和完整结果见 [docs/EVALUATION_zh.md](https://github.com/timekettle/Babelfish-
|
| 254 |
|
| 255 |
## 许可证
|
| 256 |
|
|
@@ -269,7 +269,7 @@ python -m simulst.eval.score_sentences outputs/fleurs
|
|
| 269 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 270 |
author = {Shiyang Deng and Nanjie Li and Xiaoyong Guo and Haihua Xu and Wei Shi and Hao Huang and Xiansu Deng and Jun Guo and Yuanming Luo and Wangzheng Wu},
|
| 271 |
year = {2026},
|
| 272 |
-
url = {https://github.com/timekettle/Babelfish-
|
| 273 |
}
|
| 274 |
```
|
| 275 |
|
|
|
|
| 6 |
|
| 7 |
<div align="center">
|
| 8 |
|
| 9 |
+
[](https://huggingface.co/timekettle/Babelfish-SimulST)
|
| 10 |
+
[](https://github.com/timekettle/Babelfish-SimulST)
|
| 11 |
[](LICENSE)
|
| 12 |
|
| 13 |
</div>
|
|
|
|
| 20 |
<td align="center"><b>中文 → 英文</b></td>
|
| 21 |
</tr>
|
| 22 |
<tr>
|
| 23 |
+
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulST/resolve/main/assets/demo_en2zh.mp4" width="380" controls></video></td>
|
| 24 |
+
<td align="center"><video src="https://huggingface.co/dengshiyang2003/Babelfish-SimulST/resolve/main/assets/demo_zh2en.mp4" width="380" controls></video></td>
|
| 25 |
</tr>
|
| 26 |
</table>
|
| 27 |
<sub>演示中的译文由本仓库开源的 Babelfish-30B-A3B 实时生成(束宽 2)。<br>界面上的原文转写与译文语音由另接的语音识别和语音合成模型生成,不在本次开源范围内。</sub>
|
|
|
|
| 124 |
- **COMET**:wmt22-comet-da;**CometKiwi**:wmt22-cometkiwi-da(不看参考译文);**BLEU**:SacreBLEU(英→中 zh 分词,中→英 13a)。译文保留标点原样打分;单句集逐句打分,长音频(MCIF、RealSI 长音频)先用 OmniSTEval 按官方句子重新切分再打分。
|
| 125 |
- **延迟**:单句集为 LAAL,长音频为重新切分后计算的 StreamLAAL;英→中按字、中→英按词计算。
|
| 126 |
- **两组延迟测法不同,不能直接比较**:Babelfish 和 Hy-SimulMT 按音频时间离线模拟,不含计算耗时;四家商业服务按实时速度送入音频,记录收到译文时的墙钟时间,包含网络往返和服务端计算。
|
| 127 |
+
- Babelfish 的成绩用束宽 2 解码(`--beams 2`);发布版默认改为贪心解码 + 复读保护,质量相当(FLEURS 略高、MCIF 低 0.5),见[部署教程 3.3](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT_zh.md#33-解码方式贪心还是束宽-2)。Hy-SimulMT-30B-A3B 使用其 SimulInfer 官方默认设置(1.6 秒一块,开启 VAD)。
|
| 128 |
- 带 * 的格子为近似值:GPT-Realtime-Translate 在 CoVoST 2 上只有部分句子有有效结果,按其余系统在同一批句子上的差值推算到全集(COMET 误差约 ±0.5)。
|
| 129 |
- 测试集规模:MCIF 21 段、RealSI 长音频每个方向 10 段、FLEURS 646 / 945 句、CoVoST 2 15,530 / 4,898 句、ACL 60/60 dev 468 句、eval 416 句、RealSI 单句 346 / 431 句。
|
| 130 |
+
- 0–1 分制的原始分数、量化版和不同解码方式的对比见 [docs/EVALUATION_zh.md](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/EVALUATION_zh.md)。
|
| 131 |
|
| 132 |
</details>
|
| 133 |
|
|
|
|
| 135 |
|
| 136 |
| 模型名 | 简介 | 推理框架 | 下载 |
|
| 137 |
|---|---|---|---|
|
| 138 |
+
| Babelfish-30B-A3B | FP16 原版 | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B) |
|
| 139 |
+
| Babelfish-30B-A3B-FP8 | FP8 量化(逐 128×128 块缩放) | vLLM | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B-FP8) |
|
| 140 |
+
| Babelfish-30B-A3B-GGUF | Q8_0 / Q4_K_M + 音频编码器 | llama.cpp | [Hugging Face](https://huggingface.co/timekettle/Babelfish-SimulST/tree/main/Babelfish-30B-A3B-GGUF) |
|
| 141 |
|
| 142 |
| 版本 | 权重大小 | 显存 | 质量 | 适合 |
|
| 143 |
|---|---|---|---|---|
|
|
|
|
| 147 |
|
| 148 |
## 部署推理服务
|
| 149 |
|
| 150 |
+
> 详细说明(环境、显存、多卡、HTTPS、接口协议、常见问题)见 **[部署教程](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT_zh.md)**。
|
| 151 |
|
| 152 |
### 环境要求
|
| 153 |
|
|
|
|
| 160 |
先创建并激活 conda 环境,再安装依赖:
|
| 161 |
|
| 162 |
```bash
|
| 163 |
+
git clone https://github.com/timekettle/Babelfish-SimulST.git
|
| 164 |
+
cd Babelfish-SimulST
|
| 165 |
|
| 166 |
conda create -n babelfish python=3.12 -y
|
| 167 |
conda activate babelfish
|
|
|
|
| 180 |
|
| 181 |
```bash
|
| 182 |
# 从 Hugging Face 下载并启动(FP16 原版)
|
| 183 |
+
bash scripts/deploy.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B
|
| 184 |
# FP8 版
|
| 185 |
+
bash scripts/deploy.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B-FP8
|
| 186 |
# 本地权重,指定单卡或两卡张量并行
|
| 187 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 188 |
bash scripts/deploy.sh --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
|
|
|
| 191 |
也可以给脚本加 `--install`,自动创建并配置名为 `babelfish` 的 conda 环境(驱动只到 CUDA 12.x 时加 `--cu129`):
|
| 192 |
|
| 193 |
```bash
|
| 194 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B
|
| 195 |
```
|
| 196 |
|
| 197 |
或不用脚本,在 `babelfish` conda 环境里直接启动服务:
|
|
|
|
| 216 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 217 |
```
|
| 218 |
|
| 219 |
+
- **实时 WebSocket**:连接 `ws://服务器地址:8080/translate/ws`,先发 `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`,收到 `ready` 后发送 PCM 二进制音频,结束时发 `{"eof":true}`,一直接收到 `done`。协议见 [部署教程 · 接口](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT_zh.md#接口)。
|
| 220 |
|
| 221 |
### llama.cpp(GGUF)
|
| 222 |
|
| 223 |
GGUF 版用 llama.cpp 运行(Q8_0 30.3 GiB / Q4_K_M 17.3 GiB,外加 1.2 GiB 的音频编码器),推理逻辑和复读保护与 vLLM 版相同。
|
| 224 |
|
| 225 |
+
**要达到 vLLM 版的质量,需要给 llama.cpp 打一个音频补丁**([patches/llama.cpp](https://github.com/timekettle/Babelfish-SimulST/tree/main/patches/llama.cpp)):llama.cpp 会把最后不满 1 秒的音频补零后照常编码,模型以为听到了更多音频,于是过早开口。打补丁后 Q8_0 与 vLLM 持平(FLEURS 英→中 COMET 88.8 vs 88.9);不打也能运行,但 COMET 低约 1.4、出字早约 0.65 s。
|
| 226 |
|
| 227 |
```bash
|
| 228 |
# 编译打过补丁的 llama.cpp
|
| 229 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 230 |
+
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # 在 Babelfish-SimulST 仓库目录下 clone 时的相对路径
|
| 231 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 232 |
# 一键启动 llama-server 和网页 / 接口服务(接口与 vLLM 版相同)
|
| 233 |
+
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-SimulST/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
|
| 234 |
```
|
| 235 |
|
| 236 |
+
默认贪心解码 + 复读保护。llama.cpp 上也能用束搜索(`--beams 2`),但实测质量没有比贪心更好、每步耗时翻倍,所以不作为默认。llama.cpp 不会把多路音频的预填拼成一批,A800 上 24 s 窗口每步约 0.5 s(超过 0.32 s 的节拍),长音频的实时会话会合并音频块、延迟变大,更适合离线转写、短句或没有 vLLM 的环境。详见[部署教程 · llama.cpp](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT_zh.md#7-llamacppgguf-版)。
|
| 237 |
|
| 238 |
### 离线批量推理与评测
|
| 239 |
|
| 240 |
+
一批音频文件按流式方式译完(每条输出译文和每个字的输出时刻),清单格式见[部署教程 · 离线批量推理](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/DEPLOYMENT_zh.md#8-离线批量推理):
|
| 241 |
|
| 242 |
```bash
|
| 243 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
|
|
| 250 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 251 |
```
|
| 252 |
|
| 253 |
+
测试集准备、长音频打分和完整结果见 [docs/EVALUATION_zh.md](https://github.com/timekettle/Babelfish-SimulST/blob/main/docs/EVALUATION_zh.md)。
|
| 254 |
|
| 255 |
## 许可证
|
| 256 |
|
|
|
|
| 269 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 270 |
author = {Shiyang Deng and Nanjie Li and Xiaoyong Guo and Haihua Xu and Wei Shi and Hao Huang and Xiansu Deng and Jun Guo and Yuanming Luo and Wangzheng Wu},
|
| 271 |
year = {2026},
|
| 272 |
+
url = {https://github.com/timekettle/Babelfish-SimulST}
|
| 273 |
}
|
| 274 |
```
|
| 275 |
|