X-ASR
This section describes how to use models from X-ASR.
X-ASR is a zipformer transducer model supporting both Chinese and English. We have exported it to sherpa-onnx with the scripts in scripts/zipformer-transducer/x-asr and uploaded the models to the asr-models release.
We provide both non-streaming (offline) and streaming models. Every model comes in four flavors:
punctorno-punct: thepunctmodels also add punctuations to the recognition result
int8orfp32: theint8models are much smaller and faster; thefp32models are a bit more accurate
Non-streaming models
The model names in the table below are shortened; for instance,
punct-int8 is short for
sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03.
Please click a name to download the model archive.
Model |
Size |
|---|---|
136 MB |
|
587 MB |
|
137 MB |
|
583 MB |
Download
Please use the following commands to download the punct, int8 model:
cd /path/to/sherpa-onnx
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03.tar.bz2
tar xvf sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03.tar.bz2
rm sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03.tar.bz2
After downloading, you should find the following files:
ls -lh sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03
-rw-r--r--@ 1 fangjun staff 116K 29 Jun 16:31 bpe.model
-rw-r--r--@ 1 fangjun staff 11M 29 Jun 16:31 decoder-epoch-99-avg-1.onnx
-rw-r--r--@ 1 fangjun staff 154M 29 Jun 16:31 encoder-epoch-99-avg-1.int8.onnx
-rw-r--r--@ 1 fangjun staff 2.5M 29 Jun 16:31 joiner-epoch-99-avg-1.int8.onnx
-rw-r--r--@ 1 fangjun staff 96B 29 Jun 16:31 README.md
-rwxr-xr-x@ 1 fangjun staff 6.7K 29 Jun 16:31 test_onnx.py
drwxr-xr-x@ 6 fangjun staff 192B 29 Jun 16:27 test_wavs
-rw-r--r--@ 1 fangjun staff 57K 29 Jun 16:31 tokens.txt
Hint
The fp32 models use encoder-epoch-99-avg-1.onnx and
joiner-epoch-99-avg-1.onnx instead; the no-punct models contain
the same files with a different tokens.txt. Every model archive
contains test_wavs for testing.
Decode files
Please use the following command to decode wave files:
./build/bin/sherpa-onnx-offline \
--tokens=./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/tokens.txt \
--encoder=./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/encoder-epoch-99-avg-1.int8.onnx \
--decoder=./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/decoder-epoch-99-avg-1.onnx \
--joiner=./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=1 \
--debug=0 \
./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/test_wavs/0.wav \
./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/test_wavs/1.wav
You should see the following output:
Creating recognizer ...
recognizer created in 1.380 s
Started
Done!
./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/test_wavs/0.wav
----
./sherpa-onnx-x-asr-zipformer-transducer-zh-en-punct-int8-2026-06-03/test_wavs/1.wav
----
num threads: 1
decoding method: greedy_search
Elapsed seconds: 0.325 s
Real time factor (RTF): 0.325 / 15.153 = 0.021
{"lang": "", "emotion": "", "event": "", "text": "昨天是 Monday, today is 礼拜二, the day after tomorrow 是星期三。", "timestamps": [0.96, 1.28, 1.72, 2.20, 2.24, 2.32, 2.56, 2.84, 3.64, 4.12, 5.00, 5.52, 5.76, 6.04, 6.60, 6.96, 7.24, 7.64, 8.00, 8.28, 8.40, 8.52, 8.60, 8.96, 9.28, 9.48, 9.72, 9.96], "durations": [], "tokens":[" 昨", " 天", " 是", " ", "M", "on", "da", "y", " ,", " today", " is", " 礼", " 拜", " 二", " ,", " the", " day", " after", " to", "m", "or", "ro", "w", " 是", " 星", " 期", " 三", " 。"], "ys_log_probs": [-0.004674, -0.060819, -0.001961, -0.603339, -0.003649, -0.287405, -0.506671, -0.014338, -0.718201, -0.433950, -0.062588, -0.029154, -0.675700, -0.300030, -0.478703, -0.430641, -0.056190, -0.002273, -0.065140, -0.022382, -0.065881, -0.214587, -0.020467, -0.001062, -0.001376, -0.002102, -0.010578, -0.533596], "words": []}
{"lang": "", "emotion": "", "event": "", "text": "这是第一种, 第二种叫呃与 always, always 什么意思啊?", "timestamps": [0.96, 1.08, 1.32, 1.48, 1.60, 1.88, 2.04, 2.28, 2.48, 2.76, 3.16, 3.56, 3.88, 4.20, 4.36, 4.68, 4.72, 4.80, 4.88, 4.96, 5.00], "durations": [], "tokens":[" 这", " 是", " 第", " 一", " 种", " ,", " 第", " 二", " 种", " 叫", " 呃", " 与", " always", " ,", " always", " 什", " 么", " 意", " 思", " 啊", " ?"], "ys_log_probs": [-0.002082, -0.215847, -0.134162, -0.071787, -0.550960, -0.274389, -0.395646, -0.000075, -0.030338, -0.003742, -0.643629, -0.268322, -0.137604, -0.364014, -0.071556, -0.009150, -0.005190, -0.011646, -0.000898, -0.046764, -0.010682], "words": []}
Hint
The results contain punctuations since this is a punct model.
Streaming models
The streaming models support four chunk sizes: 160 ms, 480 ms, 960 ms, and 1920 ms. A smaller chunk size means lower latency.
The model names in the table below are shortened; for instance,
480ms-punct-int8 is short for
sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.
Please click a name to download the model archive.
Model |
Size |
|---|---|
134 MB |
|
584 MB |
|
134 MB |
|
580 MB |
|
134 MB |
|
584 MB |
|
134 MB |
|
580 MB |
|
134 MB |
|
584 MB |
|
134 MB |
|
580 MB |
|
134 MB |
|
584 MB |
|
134 MB |
|
580 MB |
Download
Please use the following commands to download the 480 ms, punct,
int8 model:
cd /path/to/sherpa-onnx
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.tar.bz2
tar xvf sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.tar.bz2
rm sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.tar.bz2
After downloading, you should find the following files:
ls -lh sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05
-rw-r--r--@ 1 fangjun staff 116K 29 Jun 16:30 bpe.model
-rw-r--r--@ 1 fangjun staff 11M 29 Jun 16:30 decoder.onnx
-rw-r--r--@ 1 fangjun staff 148M 29 Jun 16:30 encoder.int8.onnx
-rw-r--r--@ 1 fangjun staff 2.5M 29 Jun 16:30 joiner.int8.onnx
-rw-r--r--@ 1 fangjun staff 96B 29 Jun 16:30 README.md
-rwxr-xr-x@ 1 fangjun staff 7.1K 29 Jun 16:30 test_onnx.py
drwxr-xr-x@ 6 fangjun staff 192B 29 Jun 16:27 test_wavs
-rw-r--r--@ 1 fangjun staff 57K 29 Jun 16:30 tokens.txt
Hint
The fp32 models use encoder.onnx and joiner.onnx instead; the
no-punct models contain the same files with a different tokens.txt.
Decode a file
Please use the following command to decode a wave file:
./build/bin/sherpa-onnx \
--tokens=./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/tokens.txt \
--encoder=./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/encoder.int8.onnx \
--decoder=./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/decoder.onnx \
--joiner=./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/joiner.int8.onnx \
--num-threads=1 \
--debug=0 \
./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/test_wavs/0.wav
You should see the following output:
Start to create recognizer
Recognizer created in 1.13888 s
./sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05/test_wavs/0.wav
Number of threads: 1, Elapsed seconds: 0.36, Audio duration (s): 10, Real time factor (RTF) = 0.36/10 = 0.036
昨天是 Monday, today is 礼拜二, the day after tomorrow 是星期三
{ "text": "昨天是 Monday, today is 礼拜二, the day after tomorrow 是星期三", "tokens": [" 昨", " 天", " 是", " ", "M", "on", "da", "y", " ,", " today", " is", " 礼", " 拜", " 二", " ,", " the", " day", " after", " to", "m", "or", "ro", "w", " 是", " 星", " 期", " 三"], "timestamps": [1.68, 2.04, 2.36, 2.76, 2.80, 2.84, 3.08, 3.32, 4.44, 4.92, 5.76, 6.08, 6.36, 6.68, 7.24, 7.68, 7.92, 8.24, 8.68, 8.92, 9.08, 9.24, 9.28, 9.68, 10.08, 10.36, 10.76], "ys_probs": [-0.485657, -0.020656, -0.670995, -1.413756, -0.081861, -0.510467, -0.485225, -0.203742, -0.892859, -0.741048, -0.470651, -0.411964, -1.222843, -0.530162, -0.878422, -0.802895, -0.157161, -0.756924, -0.660144, -0.488669, -0.045272, -0.355056, -0.614424, -0.680222, -0.349567, -0.194051, -0.286354], "lm_probs": [], "context_scores": [], "segment": 0, "words": [], "num_trailing_blanks": 6, "start_time": 0.00, "is_final": false, "is_eof": false}
Use X-ASR with our APIs
You can use the X-ASR models with all APIs of sherpa-onnx. In the following pages, we describe step by step how to use the models above in each programming language; every demo was tested and the expected output is shown.