Views
No views yet
ctc revision, 16-layer Conformer, d_model 768) — repo rootlarge_ctc revision, 24-layer Conformer, d_model 1024) — large/
subfolder; noticeably more accurate (especially on English), ~2.5× slower
on CPU (int8: RTF ≈ 0.14 vs ≈ 0.06 for 220M, Apple silicon, 4 threads)export-onnx-ctc-multilingual.py in this repo is an adaptation of that
pack's export script): sherpa metadata (model_type=EncDecCTCModel,
is_giga_am=1, subsampling_factor=4, vocab_size=71) is embedded into the
ONNX graph and the char-wise vocabulary is written as tokens.txt
(space, ', a–z, Cyrillic incl. ё, and Kazakh/Kyrgyz letters + <blk>).| File | Description |
|---|---|
model.int8.onnx | 220M, dynamic-quantized int8 (225 MB) — recommended for CPU |
model.onnx | 220M, fp32 export (885 MB) |
tokens.txt | 71 char-wise tokens (<token> <id>, <blk> last) — identical for both variants |
multilingual_ctc.yaml | source model config from the gigaam package |
large/model.int8.onnx | 600M, int8, single self-contained file (592 MB) |
large/model.onnx + large/model.onnx.data | 600M fp32; weights exceed the 2 GB protobuf limit, so the graph references one external-data file (must be kept side by side) |
large/tokens.txt, large/multilingual_large_ctc.yaml | tokens (same 71) and source config of the large variant |
export-onnx-ctc-multilingual.py | reproducible export script (pip install gigaam onnx onnxruntime), --model multilingual_ctc | multilingual_large_ctc |
n_fft=320, win_length=320, hop_length=160 —
i.e. feature_dim=64 in sherpa-onnx (FeatConfig); everything else is read
from the embedded metadata.1import sherpa_onnx
2
3recognizer = sherpa_onnx.OfflineRecognizer.from_nemo_ctc(
4 model="model.int8.onnx",
5 tokens="tokens.txt",
6 num_threads=4,
7 sample_rate=16000,
8 feature_dim=64,
9)
10stream = recognizer.create_stream()
11stream.accept_waveform(16000, samples) # float32 mono 16 kHz
12recognizer.decode_stream(stream)
13print(stream.result.text)1config := &sherpa.OfflineRecognizerConfig{}
2config.FeatConfig.SampleRate = 16000
3config.FeatConfig.FeatureDim = 64
4config.ModelConfig.NemoCTC.Model = "model.int8.onnx"
5config.ModelConfig.Tokens = "tokens.txt"
6config.ModelConfig.ModelType = "nemo_ctc"
7config.DecodingMethod = "greedy_search"
8recognizer := sherpa.NewOfflineRecognizer(config)LICENSE). All model weights are © SberDevices / salute-developers —
this repo only repackages them for the sherpa-onnx runtime.