--- license: apache-2.0 language: - zh - en library_name: rapidspeech tags: - automatic-speech-recognition - streaming - zipformer2 - transducer - ggml - gguf - code-switching base_model: - GilgameshWind/X-ASR-zh-en pipeline_tag: automatic-speech-recognition --- # X-ASR zh-en streaming zipformer2 transducer — GGUF GGUF conversions of the [X-ASR zh-en](https://huggingface.co/GilgameshWind/X-ASR-zh-en) streaming **zipformer2 transducer** (k2-fsa / sherpa-onnx export), for use with [RapidSpeech.cpp](https://github.com/vieenrose/RapidSpeech.cpp) (ggml backend, CPU + CUDA). Mandarin–English code-switching ASR with punctuation. Converted with `tools/convert_xasr_to_gguf.py`. The encoder/decoder/joiner are fused into a single GGUF per chunk variant; streaming uses per-layer recurrent caches mirroring the ONNX state contract. ## Variants All four chunk variants share the **same architecture** (6 stacks / 19 layers, dims 192·256·512·768·512·256, vocab 5000); they differ only in the streaming chunk size (latency vs. accuracy trade-off). | Folder | Chunk shift | Encoder T | Latency | f16 | Q4_K | |-----------|-------------|-----------|---------|--------|--------| | `160ms/` | 16 frames | 29 | lowest | ~292 MB| ~85 MB | | `480ms/` | 48 frames | 61 | low | ~292 MB| ~85 MB | | `960ms/` | 96 frames | 109 | medium | ~292 MB| ~85 MB | | `1920ms/` | 192 frames | 205 | highest accuracy | ~292 MB| ~86 MB | Each folder contains `*-f16.gguf`, `*-q4_k.gguf`, and `tokens.txt`. In Q4_K the convolution kernels are kept at f16 (quantizing them hurts accuracy). ## Parity RapidSpeech.cpp (CPU, f16) is **token-exact with sherpa-onnx (onnxruntime CPU, fp32)** on the reference audio for all four variants. Q4_K matches to within occasional capitalization. Example (10 s zh-en code-switching clip): > 昨天是 Monday,today is 礼拜二,the day after tomorrow 是星期三 ## Benchmark (streaming, steady-state ms/chunk, warm-up excluded) Measured on an NVIDIA GB10 host (the original Jetson Nano gen1 target was unavailable). RapidSpeech CUDA uses the FP32 non-tensor path (emulating the Nano's tensor-core-less sm_53). Numbers are relative, not Nano wall-clock. | Variant | sherpa-onnx CPU | RapidSpeech CPU | RapidSpeech CUDA | |---------|----------------:|----------------:|-----------------:| | 160 ms | 16.0 | 27.7 | 26.9 | | 480 ms | 23.1 | 48.0 | 38.4 | | 960 ms | 31.1 | 83.8 | 53.3 | | 1920 ms | 40.9 | 169.7 | 83.0 | All configurations run faster than real time. CUDA's speedup over CPU grows with chunk size (1.0× → 2.0×) as larger GEMMs amortize per-chunk kernel-launch cost. ## Usage ```bash # RapidSpeech.cpp WebSocket streaming server rs-xasr-ws-server -m 960ms/x-asr-zh-en-960ms-f16.gguf --port 6006 ``` See [RapidSpeech.cpp](https://github.com/vieenrose/RapidSpeech.cpp) for build instructions (incl. the CUDA-10.2 / sm_53 Jetson Nano path). ## License Apache-2.0, following the upstream X-ASR model.