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"
Update GitHub repo name to timekettle/Babelfish-SimulMT and subfolder model paths
Browse files- README.md +17 -17
- README_zh.md +17 -17
README.md
CHANGED
|
@@ -24,7 +24,7 @@ tags:
|
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
[](https://huggingface.co/timekettle/Babelfish-SimulMT)
|
| 27 |
-
[](https://github.com/
|
| 28 |
[](LICENSE)
|
| 29 |
|
| 30 |
</div>
|
|
@@ -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/
|
| 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/
|
| 148 |
|
| 149 |
</details>
|
| 150 |
|
|
@@ -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/
|
| 168 |
|
| 169 |
### Requirements
|
| 170 |
|
|
@@ -175,9 +175,9 @@ COMET and CometKiwi are on a 0–100 scale. The best value in each column of eac
|
|
| 175 |
### One-command deployment (vLLM)
|
| 176 |
|
| 177 |
```bash
|
| 178 |
-
git clone https://github.com/
|
| 179 |
-
cd Babelfish
|
| 180 |
-
bash scripts/deploy.sh --install --model
|
| 181 |
```
|
| 182 |
|
| 183 |
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.
|
|
@@ -186,11 +186,11 @@ More examples:
|
|
| 186 |
|
| 187 |
```bash
|
| 188 |
# NVIDIA driver supports CUDA 12.x only: install the CUDA 12.9 builds of vLLM / torch
|
| 189 |
-
bash scripts/deploy.sh --install --cu129 --model
|
| 190 |
# existing vLLM environment, local model
|
| 191 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 192 |
# FP8 version
|
| 193 |
-
bash scripts/deploy.sh --install --model
|
| 194 |
# tensor parallelism over two GPUs
|
| 195 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
| 196 |
```
|
|
@@ -218,28 +218,28 @@ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
|
|
| 218 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 219 |
```
|
| 220 |
|
| 221 |
-
- **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/
|
| 222 |
|
| 223 |
### llama.cpp (GGUF)
|
| 224 |
|
| 225 |
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.
|
| 226 |
|
| 227 |
-
**To match the vLLM version, llama.cpp needs an audio patch** ([patches/llama.cpp](https://github.com/
|
| 228 |
|
| 229 |
```bash
|
| 230 |
# build llama.cpp with the patch
|
| 231 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 232 |
-
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # path when cloned inside the Babelfish repository
|
| 233 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 234 |
# start llama-server and the web / API service (same APIs as the vLLM version)
|
| 235 |
-
bash scripts/deploy_llamacpp.sh --model
|
| 236 |
```
|
| 237 |
|
| 238 |
-
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/
|
| 239 |
|
| 240 |
### Offline batch inference and evaluation
|
| 241 |
|
| 242 |
-
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/
|
| 243 |
|
| 244 |
```bash
|
| 245 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
@@ -252,7 +252,7 @@ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --ma
|
|
| 252 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 253 |
```
|
| 254 |
|
| 255 |
-
Test-set preparation, long-form scoring and the full results: [docs/EVALUATION.md](https://github.com/
|
| 256 |
|
| 257 |
## License
|
| 258 |
|
|
@@ -271,7 +271,7 @@ If Babelfish helps your work, please cite:
|
|
| 271 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 272 |
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},
|
| 273 |
year = {2026},
|
| 274 |
-
url = {https://github.com/
|
| 275 |
}
|
| 276 |
```
|
| 277 |
|
|
|
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
[](https://huggingface.co/timekettle/Babelfish-SimulMT)
|
| 27 |
+
[](https://github.com/timekettle/Babelfish-SimulMT)
|
| 28 |
[](LICENSE)
|
| 29 |
|
| 30 |
</div>
|
|
|
|
| 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-SimulMT/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-SimulMT/blob/main/docs/EVALUATION.md).
|
| 148 |
|
| 149 |
</details>
|
| 150 |
|
|
|
|
| 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-SimulMT/blob/main/docs/DEPLOYMENT.md)**.
|
| 168 |
|
| 169 |
### Requirements
|
| 170 |
|
|
|
|
| 175 |
### One-command deployment (vLLM)
|
| 176 |
|
| 177 |
```bash
|
| 178 |
+
git clone https://github.com/timekettle/Babelfish-SimulMT.git
|
| 179 |
+
cd Babelfish-SimulMT
|
| 180 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B
|
| 181 |
```
|
| 182 |
|
| 183 |
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.
|
|
|
|
| 186 |
|
| 187 |
```bash
|
| 188 |
# NVIDIA driver supports CUDA 12.x only: install the CUDA 12.9 builds of vLLM / torch
|
| 189 |
+
bash scripts/deploy.sh --install --cu129 --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B
|
| 190 |
# existing vLLM environment, local model
|
| 191 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 192 |
# FP8 version
|
| 193 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B-FP8
|
| 194 |
# tensor parallelism over two GPUs
|
| 195 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
| 196 |
```
|
|
|
|
| 218 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 219 |
```
|
| 220 |
|
| 221 |
+
- **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-SimulMT/blob/main/docs/DEPLOYMENT.md#api).
|
| 222 |
|
| 223 |
### llama.cpp (GGUF)
|
| 224 |
|
| 225 |
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.
|
| 226 |
|
| 227 |
+
**To match the vLLM version, llama.cpp needs an audio patch** ([patches/llama.cpp](https://github.com/timekettle/Babelfish-SimulMT/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.
|
| 228 |
|
| 229 |
```bash
|
| 230 |
# build llama.cpp with the patch
|
| 231 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 232 |
+
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # path when cloned inside the Babelfish-SimulMT repository
|
| 233 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 234 |
# start llama-server and the web / API service (same APIs as the vLLM version)
|
| 235 |
+
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
|
| 236 |
```
|
| 237 |
|
| 238 |
+
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-SimulMT/blob/main/docs/DEPLOYMENT.md#7-llamacpp-gguf-version).
|
| 239 |
|
| 240 |
### Offline batch inference and evaluation
|
| 241 |
|
| 242 |
+
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-SimulMT/blob/main/docs/DEPLOYMENT.md#8-offline-batch-inference):
|
| 243 |
|
| 244 |
```bash
|
| 245 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
|
|
| 252 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 253 |
```
|
| 254 |
|
| 255 |
+
Test-set preparation, long-form scoring and the full results: [docs/EVALUATION.md](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/EVALUATION.md).
|
| 256 |
|
| 257 |
## License
|
| 258 |
|
|
|
|
| 271 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 272 |
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},
|
| 273 |
year = {2026},
|
| 274 |
+
url = {https://github.com/timekettle/Babelfish-SimulMT}
|
| 275 |
}
|
| 276 |
```
|
| 277 |
|
README_zh.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
<div align="center">
|
| 8 |
|
| 9 |
[](https://huggingface.co/timekettle/Babelfish-SimulMT)
|
| 10 |
-
[](https://github.com/
|
| 11 |
[](LICENSE)
|
| 12 |
|
| 13 |
</div>
|
|
@@ -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/
|
| 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/
|
| 131 |
|
| 132 |
</details>
|
| 133 |
|
|
@@ -147,7 +147,7 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 147 |
|
| 148 |
## 部署推理服务
|
| 149 |
|
| 150 |
-
> 详细说明(环境、显存、多卡、HTTPS、接口协议、常见问题)见 **[部署教程](https://github.com/
|
| 151 |
|
| 152 |
### 环境要求
|
| 153 |
|
|
@@ -158,9 +158,9 @@ COMET 和 CometKiwi 为百分制(0–100);每个指标每列最好的值
|
|
| 158 |
### 一键部署(vLLM)
|
| 159 |
|
| 160 |
```bash
|
| 161 |
-
git clone https://github.com/
|
| 162 |
-
cd Babelfish
|
| 163 |
-
bash scripts/deploy.sh --install --model
|
| 164 |
```
|
| 165 |
|
| 166 |
命令会在 `.simulst/env` 新建环境并安装 vLLM 和本项目、下载模型、启动服务。看到 `Ready: http://127.0.0.1:8080/` 后即可使用,按 Ctrl+C 停止。
|
|
@@ -169,11 +169,11 @@ bash scripts/deploy.sh --install --model TimeKettle/Babelfish-30B-A3B
|
|
| 169 |
|
| 170 |
```bash
|
| 171 |
# 显卡驱动只支持到 CUDA 12.x:安装 CUDA 12.9 构建的 vLLM / torch
|
| 172 |
-
bash scripts/deploy.sh --install --cu129 --model
|
| 173 |
# 已有 vLLM 环境、模型已在本地
|
| 174 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 175 |
# FP8 版
|
| 176 |
-
bash scripts/deploy.sh --install --model
|
| 177 |
# 两张卡张量并行
|
| 178 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
| 179 |
```
|
|
@@ -201,28 +201,28 @@ python -m simulst.server --model /path/to/Babelfish-30B-A3B --port 8080
|
|
| 201 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 202 |
```
|
| 203 |
|
| 204 |
-
- **实时 WebSocket**:连接 `ws://服务器地址:8080/translate/ws`,先发 `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`,收到 `ready` 后发送 PCM 二进制音频,结束时发 `{"eof":true}`,一直接收到 `done`。协议见 [部署教程 · 接口](https://github.com/
|
| 205 |
|
| 206 |
### llama.cpp(GGUF)
|
| 207 |
|
| 208 |
GGUF 版用 llama.cpp 运行(Q8_0 30.3 GiB / Q4_K_M 17.3 GiB,外加 1.2 GiB 的音频编码器),推理逻辑和复读保护与 vLLM 版相同。
|
| 209 |
|
| 210 |
-
**要达到 vLLM 版的质量,需要给 llama.cpp 打一个音频补丁**([patches/llama.cpp](https://github.com/
|
| 211 |
|
| 212 |
```bash
|
| 213 |
# 编译打过补丁的 llama.cpp
|
| 214 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 215 |
-
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # 在 Babelfish 仓库目录下 clone 时的相对路径
|
| 216 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 217 |
# 一键启动 llama-server 和网页 / 接口服务(接口与 vLLM 版相同)
|
| 218 |
-
bash scripts/deploy_llamacpp.sh --model
|
| 219 |
```
|
| 220 |
|
| 221 |
-
默认贪心解码 + 复读保护。llama.cpp 上也能用束搜索(`--beams 2`),但实测质量没有比贪心更好、每步耗时翻倍,所以不作为默认。llama.cpp 不会把多路音频的预填拼成一批,A800 上 24 s 窗口每步约 0.5 s(超过 0.32 s 的节拍),长音频的实时会话会合并音频块、延迟变大,更适合离线转写、短句或没有 vLLM 的环境。详见[部署教程 · llama.cpp](https://github.com/
|
| 222 |
|
| 223 |
### 离线批量推理与评测
|
| 224 |
|
| 225 |
-
一批音频文件按流式方式译完(每条输出译文和每个字的输出时刻),清单格式见[部署教程 · 离线批量推理](https://github.com/
|
| 226 |
|
| 227 |
```bash
|
| 228 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
@@ -235,7 +235,7 @@ python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --beams 2 --ma
|
|
| 235 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 236 |
```
|
| 237 |
|
| 238 |
-
测试集准备、长音频打分和完整结果见 [docs/EVALUATION_zh.md](https://github.com/
|
| 239 |
|
| 240 |
## 许可证
|
| 241 |
|
|
@@ -254,7 +254,7 @@ python -m simulst.eval.score_sentences outputs/fleurs
|
|
| 254 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 255 |
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},
|
| 256 |
year = {2026},
|
| 257 |
-
url = {https://github.com/
|
| 258 |
}
|
| 259 |
```
|
| 260 |
|
|
|
|
| 7 |
<div align="center">
|
| 8 |
|
| 9 |
[](https://huggingface.co/timekettle/Babelfish-SimulMT)
|
| 10 |
+
[](https://github.com/timekettle/Babelfish-SimulMT)
|
| 11 |
[](LICENSE)
|
| 12 |
|
| 13 |
</div>
|
|
|
|
| 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-SimulMT/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-SimulMT/blob/main/docs/EVALUATION_zh.md)。
|
| 131 |
|
| 132 |
</details>
|
| 133 |
|
|
|
|
| 147 |
|
| 148 |
## 部署推理服务
|
| 149 |
|
| 150 |
+
> 详细说明(环境、显存、多卡、HTTPS、接口协议、常见问题)见 **[部署教程](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/DEPLOYMENT_zh.md)**。
|
| 151 |
|
| 152 |
### 环境要求
|
| 153 |
|
|
|
|
| 158 |
### 一键部署(vLLM)
|
| 159 |
|
| 160 |
```bash
|
| 161 |
+
git clone https://github.com/timekettle/Babelfish-SimulMT.git
|
| 162 |
+
cd Babelfish-SimulMT
|
| 163 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B
|
| 164 |
```
|
| 165 |
|
| 166 |
命令会在 `.simulst/env` 新建环境并安装 vLLM 和本项目、下载模型、启动服务。看到 `Ready: http://127.0.0.1:8080/` 后即可使用,按 Ctrl+C 停止。
|
|
|
|
| 169 |
|
| 170 |
```bash
|
| 171 |
# 显卡驱动只支持到 CUDA 12.x:安装 CUDA 12.9 构建的 vLLM / torch
|
| 172 |
+
bash scripts/deploy.sh --install --cu129 --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B
|
| 173 |
# 已有 vLLM 环境、模型已在本地
|
| 174 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0
|
| 175 |
# FP8 版
|
| 176 |
+
bash scripts/deploy.sh --install --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B-FP8
|
| 177 |
# 两张卡张量并行
|
| 178 |
bash scripts/deploy.sh --python /path/to/env/bin/python --model /path/to/Babelfish-30B-A3B --gpus 0,1
|
| 179 |
```
|
|
|
|
| 201 |
curl -N http://127.0.0.1:8080/translate/stream -F direction=en2zh -F file=@audio.wav
|
| 202 |
```
|
| 203 |
|
| 204 |
+
- **实时 WebSocket**:连接 `ws://服务器地址:8080/translate/ws`,先发 `{"direction":"en2zh","sample_rate":16000,"format":"s16le","channels":1}`,收到 `ready` 后发送 PCM 二进制音频,结束时发 `{"eof":true}`,一直接收到 `done`。协议见 [部署教程 · 接口](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/DEPLOYMENT_zh.md#接口)。
|
| 205 |
|
| 206 |
### llama.cpp(GGUF)
|
| 207 |
|
| 208 |
GGUF 版用 llama.cpp 运行(Q8_0 30.3 GiB / Q4_K_M 17.3 GiB,外加 1.2 GiB 的音频编码器),推理逻辑和复读保护与 vLLM 版相同。
|
| 209 |
|
| 210 |
+
**要达到 vLLM 版的质量,需要给 llama.cpp 打一个音频补丁**([patches/llama.cpp](https://github.com/timekettle/Babelfish-SimulMT/tree/main/patches/llama.cpp)):llama.cpp 会把最后不满 1 秒的音频补零后照常编码,模型以为听到了更多音频,于是过早开口。打补丁后 Q8_0 与 vLLM 持平(FLEURS 英→中 COMET 88.8 vs 88.9);不打也能运行,但 COMET 低约 1.4、出字早约 0.65 s。
|
| 211 |
|
| 212 |
```bash
|
| 213 |
# 编译打过补丁的 llama.cpp
|
| 214 |
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout 3f8af15a76ac8675812e856da45454bafc90f12c
|
| 215 |
+
git apply ../patches/llama.cpp/qwen3-omni-audio-valid-tokens.patch # 在 Babelfish-SimulMT 仓库目录下 clone 时的相对路径
|
| 216 |
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server && cd ..
|
| 217 |
# 一键启动 llama-server 和网页 / 接口服务(接口与 vLLM 版相同)
|
| 218 |
+
bash scripts/deploy_llamacpp.sh --model timekettle/Babelfish-SimulMT/Babelfish-30B-A3B-GGUF --quant Q4_K_M --llama-server llama.cpp/build/bin/llama-server
|
| 219 |
```
|
| 220 |
|
| 221 |
+
默认贪心解码 + 复读保护。llama.cpp 上也能用束搜索(`--beams 2`),但实测质量没有比贪心更好、每步耗时翻倍,所以不作为默认。llama.cpp 不会把多路音频的预填拼成一批,A800 上 24 s 窗口每步约 0.5 s(超过 0.32 s 的节拍),长音频的实时会话会合并音频块、延迟变大,更适合离线转写、短句或没有 vLLM 的环境。详见[部署教程 · llama.cpp](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/DEPLOYMENT_zh.md#7-llamacppgguf-版)。
|
| 222 |
|
| 223 |
### 离线批量推理与评测
|
| 224 |
|
| 225 |
+
一批音频文件按流式方式译完(每条输出译文和每个字的输出时刻),清单格式见[部署教程 · 离线批量推理](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/DEPLOYMENT_zh.md#8-离线批量推理):
|
| 226 |
|
| 227 |
```bash
|
| 228 |
python -m simulst.infer.stream --model /path/to/Babelfish-30B-A3B --manifests talks=talks.jsonl --out outputs/
|
|
|
|
| 235 |
python -m simulst.eval.score_sentences outputs/fleurs
|
| 236 |
```
|
| 237 |
|
| 238 |
+
测试集准备、长音频打分和完整结果见 [docs/EVALUATION_zh.md](https://github.com/timekettle/Babelfish-SimulMT/blob/main/docs/EVALUATION_zh.md)。
|
| 239 |
|
| 240 |
## 许可证
|
| 241 |
|
|
|
|
| 254 |
title = {Babelfish: Low-Latency Streaming Simultaneous Speech Translation between English and Chinese},
|
| 255 |
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},
|
| 256 |
year = {2026},
|
| 257 |
+
url = {https://github.com/timekettle/Babelfish-SimulMT}
|
| 258 |
}
|
| 259 |
```
|
| 260 |
|