CoolFace
Modelpublic

bookbot/sherpa-onnx-ort-zipformer-streaming-robust-es-v1

sourceHugging Facecc-by-nc-sa-3.0updated 3d agoView on Hugging Face
0likes
Model Card

Spanish Zipformer Streaming Robust ES v1 — ONNX Runtime

This repository contains the ONNX Runtime (ORT) package for the Spanish streaming Zipformer v1 model. It recognizes whitespace-separated IPA phone symbols, not words. The package was exported from the exact evaluated average of epochs 76–80 in `bookbot/zipformer-streaming-robust-es-v1`:

  • —checkpoint: evaluated-avg-76-80.pt
  • —checkpoint SHA-256: d5cde97d82c214da39c3d9decffa84eaf6b15869c7b6521d2f184a2e59ad30e5
  • —causal streaming: chunk size 16, left context 128 frames
  • —feature input: 80-dimensional Kaldi fbank, 16 kHz, no dithering, snip_edges=false
  • —model architecture: the v1 six-stack atomic-phone Zipformer configuration in `export-config.json`

The six published models are fixed-optimization ORT files. The intermediate ONNX files and the epoch-999.pt scratch alias are deliberately not included.

Files

FilePurpose
encoder-evaluated-avg-76-80-chunk-16-left-128.ortFP32 streaming encoder
decoder-evaluated-avg-76-80-chunk-16-left-128.ortFP32 decoder
joiner-evaluated-avg-76-80-chunk-16-left-128.ortFP32 joiner
encoder-evaluated-avg-76-80-chunk-16-left-128.int8.ortDynamic-INT8 streaming encoder
decoder-evaluated-avg-76-80-chunk-16-left-128.int8.ortDynamic-INT8 decoder
joiner-evaluated-avg-76-80-chunk-16-left-128.int8.ortDynamic-INT8 joiner
tokens.txtAtomic v1 phone inventory
required_operators.configORT reduced-operator configuration for all six models
common_voice_es_19696062-9131.wavCC0 16 kHz smoke sample
run_streaming.pyRunnable CPU sherpa-onnx streaming example
export-config.jsonReproducible export and architecture settings
sample-provenance.jsonSource ID, cut, license, and waveform provenance
runtime-checks.jsonLocal load, parity, output, and RTF evidence
SHA256SUMSSHA-256 manifest for every published file except this manifest itself

Usage

Install a compatible sherpa-onnx Python package, then run the included example from this directory:

bash
python run_streaming.py

To use dynamic INT8 instead:

bash
python run_streaming.py \
  --encoder encoder-evaluated-avg-76-80-chunk-16-left-128.int8.ort \
  --decoder decoder-evaluated-avg-76-80-chunk-16-left-128.int8.ort \
  --joiner joiner-evaluated-avg-76-80-chunk-16-left-128.int8.ort

The example uses CPU greedy streaming decoding, adds 0.3 seconds of tail padding, prints the phone-token sequence as JSON, validates every emitted token against tokens.txt, and reports real-time factor (RTF). For a different waveform, pass --audio path/to/audio.wav; it must be mono 16-bit PCM at 16 kHz.

Reproducing the export

Run these commands from icefall/egs/bookbot_es/ASR with ONNX Runtime 1.23.2. The exporter reads the exact materialized average, not a newly computed or single-epoch checkpoint:

bash
native=tmp/zipformer-streaming-robust-es-v1
git lfs install
mkdir -p tmp
if [ ! -d "$native" ]; then
  git clone \
    https://huggingface.co/bookbot/zipformer-streaming-robust-es-v1 \
    "$native"
fi
scratch="$(mktemp -d)"
ln -s "$(realpath "$native/evaluated-avg-76-80.pt")" \
  "$scratch/epoch-999.pt"

python zipformer/export-onnx-streaming.py \
  --tokens "$native/data/lang_phone/tokens.txt" \
  --epoch 999 \
  --avg 1 \
  --use-averaged-model false \
  --exp-dir "$scratch" \
  --num-encoder-layers 2,2,2,2,2,2 \
  --downsampling-factor 1,2,4,8,4,2 \
  --feedforward-dim 512,768,768,768,768,768 \
  --num-heads 4,4,4,8,4,4 \
  --encoder-dim 192,256,256,256,256,256 \
  --query-head-dim 32 \
  --value-head-dim 12 \
  --pos-head-dim 4 \
  --pos-dim 48 \
  --encoder-unmasked-dim 192,192,192,192,192,192 \
  --cnn-module-kernel 31,31,15,15,15,31 \
  --decoder-dim 512 \
  --joiner-dim 512 \
  --context-size 2 \
  --causal true \
  --chunk-size 16 \
  --left-context-frames 128 \
  --use-transducer true

for component in encoder decoder joiner; do
  mv "$scratch/${component}-epoch-999-avg-1-chunk-16-left-128.onnx" \
    "$scratch/${component}-evaluated-avg-76-80-chunk-16-left-128.onnx"
  mv "$scratch/${component}-epoch-999-avg-1-chunk-16-left-128.int8.onnx" \
    "$scratch/${component}-evaluated-avg-76-80-chunk-16-left-128.int8.onnx"
done

export-onnx-streaming.py emits FP32 and dynamic-QInt8 ONNX files using opset 13. Convert all six to fixed-optimization ORT:

bash
(
  cd "$scratch"
  python -m onnxruntime.tools.convert_onnx_models_to_ort \
    --optimization_style=Fixed \
    .
)

python -c 'import glob, sys, onnxruntime as ort; [ort.InferenceSession(p, providers=["CPUExecutionProvider"]) for p in glob.glob(sys.argv[1] + "/*.ort")]' "$scratch"
rm -f "$scratch"/*.onnx "$scratch"/epoch-999.pt

The converter also writes required_operators.config. Keep that file with the six ORT models. The intermediate ONNX files and epoch-999.pt alias are scratch-only and are intentionally absent from this repository. Full architecture, quantization operator, and output-name metadata is in `export-config.json`.

Data and licensing

The model was trained on the following sources:

  • —Common Voice 23.0 Spanish, source license CC0-1.0, with the versioned recipe cut publication at `bookbot/common-voice-23-0-es-ipa-v1`. Mozilla Data Collective source-use notices and attribution still apply.
  • —OpenSLR72, source license CC BY-SA 4.0, with the versioned recipe cut publication at `bookbot/slr72-es-ipa-v1`. Preserve the OpenSLR72 attribution and citation when redistributing derived data.
  • —TinyVox, used during training and evaluation under CC BY-NC-SA 3.0. TinyVox is child-speech data; this repository contains no TinyVox audio, metadata, rows, or utterance-level outputs. Only aggregate TinyVox metrics are reported below. The resulting weights and this ORT package are therefore released under the conservative CC BY-NC-SA 3.0 license and are non-commercial.

The included smoke waveform is the Common Voice test cut common_voice_es_19696062-9131, source recording common_voice_es_19696062, and is CC0-1.0. Its pinned source identity, transcript, resampling, and SHA-256 are recorded in `sample-provenance.json`.

Evaluation

The metric in this table is phoneme error rate (PER). Icefall's historical output filenames sometimes use the generic WER label (wer-summary-* and errs-*); those filenames do not change the metric, which is PER here.

DecoderCommon Voice 23.0 ESSLR72TinyVox validationTinyVox test
Greedy2.8076%1.5325%25.5180%33.7509%
Modified beam, 4 active paths2.6908%1.3961%24.5529%32.9158%
Reference fast beam, beam 4 / 4 contexts / 32 states / blank penalty 074.9781%50.2461%85.2399%88.0634%
Selected fast beam, beam 8 / 4 contexts / 32 states / blank penalty 3.13.1927%1.5544%36.8720%45.7883%

The recommended decoder is modified beam search with num_active_paths=4. Common Voice 23.0 Spanish and SLR72 values reuse the recipe's official test splits for validation, so they are not independent holdout measurements. TinyVox test is the independently held-out result. TinyVox values are aggregate-only and do not expose utterance-level records.

Verification and hashes

Local validation loaded all six ORT files with ONNX Runtime 1.23.2 and ran CPU sherpa-onnx 1.13.6 streaming inference on the included waveform. FP32 emitted exactly the same 62-phone sequence as the canonical TorchScript inference from the checkpoint above. Dynamic INT8 completed successfully and emitted only tokens from the v1 inventory. The measured local RTFs and complete JSON output are in `runtime-checks.json`.

Core artifact SHA-256 values:

ArtifactSHA-256
encoder-evaluated-avg-76-80-chunk-16-left-128.ort956c717b55e6716f1d2a9a6a2d774a750453f3b13d373b26ccd5c96ba97f4607
encoder-evaluated-avg-76-80-chunk-16-left-128.int8.orta8faca91fbe506a2d69c51aa0c0d1296ac0611e0daa5508bcd4508f17053f87d
decoder-evaluated-avg-76-80-chunk-16-left-128.ort3244ce92c3ad36a52a98700d2340dcb5791bdfba785899ed34ef1ebc8a2ee5f2
decoder-evaluated-avg-76-80-chunk-16-left-128.int8.ort0abbc52a30873c0b00589b63a96194d3bdb9451f613c0316ebed03bf6e2554e5
joiner-evaluated-avg-76-80-chunk-16-left-128.ortea2b1305f56567bf1ec64ea7068b854ca94721dce7eaff468d818a898d9f0066
joiner-evaluated-avg-76-80-chunk-16-left-128.int8.ortd393182040da9e8f05c6237e3d7e69c830e16499a4d68be933cdc894b50e5522
tokens.txt1433ed0361408ac8dd8791a5964d13eea7d713895ea3f1a1c6848f02e4e4e65c
required_operators.config58f289eb2d8b5717ad3d6869c3d855e263b225edc153617cf72a0e7c419b796a
common_voice_es_19696062-9131.wav4b3a5651a9df2b796904239873f23799ed0fe90e9b9fe511feb47288b7c21c86

SHA256SUMS is authoritative for hashes of the configuration, provenance, runtime evidence, example, and this card. It does not include itself.