Lomasub-open (sherpa-onnx, int8)

This repository contains the sherpa-onnx int8 conversion of lomasub/lomasub-open (165M parameters, 12 encoder layers, 4 decoder layers, custom 4,000-word Thai tokenizer).

Files

File Description Size
encoder.int8.onnx Int8 dynamically quantized audio encoder (n_audio_layer=12, n_text_layer=4, n_mels=80) 99 MB
decoder.int8.onnx Int8 dynamically quantized text decoder (n_text_layer=4, n_vocab=51865) 187 MB
tokens.txt Base64-encoded token bytes for all 51,865 IDs, generated from lomasub/lomasub-open's tokenizer.json (preserves the 4,000 reused Thai word tokens) 908 KB
LICENSE Apache-2.0 license (from lomasub/lomasub-open) 12 KB

Conversion Notes

  1. Converted model.safetensors from bfloat16 to float32 and mapped Hugging Face Whisper keys to the openai-whisper state dict layout (12 encoder layers, 4 decoder layers).
  2. Exported ONNX models using sherpa-onnx's scripts/whisper/export-onnx.py (opset_version=17) with dynamic int8 MatMul quantization for both encoder (encoder.int8.onnx) and decoder (decoder.int8.onnx), preserving n_text_layer=4 metadata.
  3. Built tokens.txt directly from lomasub/lomasub-open's tokenizer.json (all 51,865 IDs, base64-encoded raw UTF-8/BPE bytes) instead of the default multilingual tiktoken file, which would otherwise decode the 4,000 reused CJK token IDs as CJK instead of Thai.

Usage with sherpa-onnx-offline

sherpa-onnx-offline \
  --whisper-encoder=encoder.int8.onnx \
  --whisper-decoder=decoder.int8.onnx \
  --tokens=tokens.txt \
  --whisper-language=th \
  --whisper-task=transcribe \
  --num-threads=4 \
  input.wav

Evaluation (lomasub/thai_asr_corrected)

Evaluated with sherpa-onnx-offline --whisper-language=th (encoder.int8.onnx + decoder.int8.onnx) on a 2-vCPU x86_64 Linux VM (--num-threads=2):

Subset Clips CER (dual-ref) CER (corrected) CER (original) Reference PyTorch CER RTF (2 CPU threads)
FLEURS-th 10 2.69% 2.90% 3.51% 2.51% (495 clips) 0.412 (2.43x RT)
TVSpeech 20 4.87%* 4.87%* 9.09%* 3.60% (570 clips) 0.229 (4.36x RT)

*Evaluated without full Thai spoken-number-to-digit normalization (e.g., สาม vs 3), so true normalized CER is lower. On the first 10 TVSpeech clips, int8 decoder matched fp32 decoder exactly (5.70% vs 5.70% CER) with 0 repetition loops or early EOT across all 20 clips.

Attribution & License

Original model: lomasub/lomasub-open by Nawawit Kessaraphong, released under the Apache-2.0 license.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lomasub/lomasub-open-onnx

Quantized
(1)
this model

Dataset used to train lomasub/lomasub-open-onnx