Back to Sherpa Onnx

Introduction

scripts/mobile-asr-models/README.md

1.13.05.7 KB
Original Source

Introduction

This folder contains scripts to convert ASR models for mobile platforms supporting only batch size equal to 1.

The advantage of fixing the batch size to 1 is that it provides more opportunities for model optimization and quantization.

To give you a concrete example, for the following model https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20-bilingual-chinese-english

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size315 MB174 MB
Batch size fixed to 1242 MB100 MB

The following colab notebook provides examples to use the above two models.

WARNING: Tested with onnxruntime==1.16.3 onnx==1.15.0.

bash
pip install onnxruntime==1.16.3 onnx==1.15.0

More examples

sherpa-onnx-streaming-zipformer-korean-2024-06-16

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size279 MB122 MB
Batch size fixed to 1264 MB107 MB

sherpa-onnx-streaming-zipformer-en-20M-2023-02-17

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size85 MB41 MB
Batch size fixed to 175 MB32 MB

sherpa-onnx-streaming-zipformer-multi-zh-hans-2023-12-12

encoder-epoch-20-avg-1-chunk-16-left-128.onnxencoder-epoch-20-avg-1-chunk-16-left-128.int8.onnx
Dynamic batch size249 MB67 MB
Batch size fixed to 1247 MB65 MB

icefall-asr-zipformer-streaming-wenetspeech-20230615

encoder-epoch-12-avg-4-chunk-16-left-128.onnxencoder-epoch-12-avg-4-chunk-16-left-128.int8.onnx
Dynamic batch size250 MB68 MB
Batch size fixed to 1247 MB65 MB

sherpa-onnx-streaming-zipformer-en-2023-06-26

encoder-epoch-99-avg-1-chunk-16-left-128.onnxencoder-epoch-99-avg-1-chunk-16-left-128.int8.onnx
Dynamic batch size250 MB68 MB
Batch size fixed to 1247 MB65 MB

sherpa-onnx-streaming-zipformer-en-2023-06-21

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size338 MB180 MB
Batch size fixed to 1264 MB107 MB

sherpa-onnx-streaming-zipformer-en-2023-02-21

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size279 MB122 MB
Batch size fixed to 1264 MB107 MB

sherpa-onnx-streaming-zipformer-fr-2023-04-14

encoder-epoch-29-avg-9-with-averaged-model.onnxencoder-epoch-29-avg-9-with-averaged-model.int8.onnx
Dynamic batch size279 MB121 MB
Batch size fixed to 1264 MB107 MB

sherpa-onnx-streaming-zipformer-small-bilingual-zh-en-2023-02-16

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size85 MB41 MB
Batch size fixed to 175 MB32 MB

sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23

encoder-epoch-99-avg-1.onnxencoder-epoch-99-avg-1.int8.onnx
Dynamic batch size40 MB21 MB
Batch size fixed to 133 MB15 MB

sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01

encoder-epoch-12-avg-2-chunk-16-left-64.onnxencoder-epoch-12-avg-2-chunk-16-left-64.int8.onnx
Dynamic batch size12 MB4.6 MB
Batch size fixed to 111 MB3.9 MB

sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01

encoder-epoch-12-avg-2-chunk-16-left-64.onnxencoder-epoch-12-avg-2-chunk-16-left-64.int8.onnx
Dynamic batch size12 MB4.6 MB
Batch size fixed to 111 MB3.9 MB