ONNX graphs for moonshine-ai/moonshine-tiny
in the layout that sherpa-onnx loads with OfflineRecognizer.from_moonshine_v2. The model, its training
data and its design belong to Moonshine AI; this repository only converts what they published, under
their MIT licence. Please cite and support the original work.
The Ukrainian counterpart is vasyadeva/moonshine-tiny-uk-sherpa-onnx.
| file | size | what it is |
|---|---|---|
encoder_model.onnx |
31 MB | raw 16 kHz audio → encoder states |
decoder_model_merged.onnx |
116 MB | cached and uncached decoder in one graph (use_cache_branch) |
tokens.txt |
sherpa format: base64 of each token's bytes, then its id | |
tokenizer.json, config.json, generation_config.json, preprocessor_config.json |
from the source model, for reference |
float32, no quantisation.
optimum-cli export onnx --model moonshine-ai/moonshine-tiny --task automatic-speech-recognition-with-past
(transformers 4.52.4, Linux x86_64). The exporter's logit comparison against PyTorch was within about
4e-5, above its 1e-5 tolerance; it saved the graphs anyway. tokens.txt was generated from
tokenizer.json: ▁ becomes a space, <0xNN> becomes that byte, each piece is base64-encoded.
Loaded with sherpa-onnx 2.0.1 and run on two synthetic clips (macOS speech synthesis, 16 kHz): «Where is the nearest pharmacy?» and «Careful, there is a step down ahead.» were transcribed correctly. A smoke test of the format, not an accuracy evaluation.
import sherpa_onnx
rec = sherpa_onnx.OfflineRecognizer.from_moonshine_v2(
encoder="encoder_model.onnx",
decoder="decoder_model_merged.onnx",
tokens="tokens.txt",
num_threads=2,
)
decoder_model_merged.onnx 116 MBencoder_model.onnx 31 MB