csukuangfj/sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en
By csukuangfj · ↓ 1 · ♥ 1 · Updated 2024-03-10
What's in this repo
This page lists the files in csukuangfj/sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en, including decoder.int8.onnx, decoder.onnx, encoder.int8.onnx and more.
- 4 ONNX models (.onnx files)
- 17 files, including 6 .wav, 4 .onnx, 2 .py, 1 .md, 1 .mvn, 1 .yaml
- Last updated 2024-03-10
ONNX files
| File | Size | Download |
|---|---|---|
| decoder.int8.onnx | — | Download |
| decoder.onnx | — | Download |
| encoder.int8.onnx | — | Download |
| encoder.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
Introduction
Files in this directory are from https://modelscope.cn/models/dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online/summary
First, we use the following Python code (using FunASR v0.8.8)
from funasr_onnx.paraformer_online_bin import Paraformer
model_dir = "dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online"
chunk_size = [5, 10, 5]
model = Paraformer(model_dir, batch_size=1, quantize=True, chunk_size=chunk_size, intra_op_num_threads=4) #, revision='v1.0.0') # only support batch_size = 1
to get the following files:
- model.onnx
- model_quant.onnx
- decoder.onnx
- decoder_quant.onnx
Then we rename the following three files:
- model.onnx -> encoder.onnx
- model_quant.onnx -> encoder.int8.onnx
- decoder_quant.onnx -> decoder.int8.onnx
Then we run
./generate-tokens.py
to get tokens.txt.
Finally, we run
./add-model-metadata.py
to add metadata to encoder.onnx and encoder.int8.onnx.
Now you can use the generated files in sherpa-onnx.
Files (17)
Related models
More from csukuangfj
More models
No task type declared.