| --- |
| license: apache-2.0 |
| language: [wuu] |
| tags: [automatic-speech-recognition, onnx, onnx-asr, whisper, wu-chinese] |
| base_model: kaiwang0574/whisper-wu |
| --- |
| |
| # whisper-wu — ONNX |
|
|
| ONNX export of [kaiwang0574/whisper-wu](https://huggingface.co/kaiwang0574/whisper-wu) |
| (a LoRA adapter over `openai/whisper-small`, fine-tuned for Wu Chinese by |
| [kaiwang0574](https://huggingface.co/kaiwang0574)) for |
| [onnx-asr](https://github.com/istupakov/onnx-asr) (standard `whisper` model type — works with |
| stock onnx-asr, no patches needed). fp32 and int8 variants included. |
|
|
| The source repo only publishes a PEFT/LoRA adapter (`adapter_config.json` + |
| `adapter_model.safetensors`, `base_model_name_or_path: openai/whisper-small`), not a merged |
| checkpoint. This export merges the adapter into the base model (`peft.merge_and_unload()`) |
| before running the standard ONNX export pipeline. |
|
|
| License: apache-2.0, inherited from the source model. |
|
|
| First specialized ONNX ASR model for Wu Chinese in this collection. |
|
|
| ## Usage |
|
|
| Whisper has no dedicated `wuu` language token; use `language="zh"` — the Wu-dialect behavior |
| comes from the fine-tune itself. |
|
|
| ```python |
| import onnx_asr |
| model = onnx_asr.load_model("whisper", "path/to/this/repo") # or quantization="int8" |
| print(model.recognize("audio_16khz.wav", language="zh")) |
| ``` |
|
|
| Verified on a clip from [MagicHub/magicdata-dialect-wu-chinese-tts-lite](https://huggingface.co/datasets/MagicHub/magicdata-dialect-wu-chinese-tts-lite) |
| (Jiangsu dialect corpus; FLEURS does not cover Wu Chinese): |
|
|
| - Reference: 倷今朝阿去园林里白相?里向个荷花开的交关好看。 |
| - fp32 (RTF 0.21): 內徑在安赤與林立巴線裡,只剩個好伙計的接歸喊口。 |
| - int8 (RTF 0.17): 內境在安赤與林立巴線,只像個好火開的接歸駭口。 |
|
|
| **Verified with caveats, honestly**: the ONNX fp32 output was cross-checked against the |
| merged model run natively through `transformers` on the same clip, and the two match closely |
| ("內徑在安赤與林立巴線裡,只剩下個好火開的接歸客戶。") — confirming the ONNX conversion is |
| faithful. The transcript itself, however, diverges substantially from the reference text. |
| This is a real accuracy limitation of the small LoRA adapter (rank 16, `q/k/v/o_proj` only) |
| on this low-resource dialect, not an artifact of this export. Treat this as a correctly |
| converted mirror of the source model, not a claim of strong Wu Chinese accuracy. RTF measured |
| on an AMD Ryzen 5 7600 (CPU, 4 OMP threads, shared/loaded box — not a clean benchmark number). |
|
|
| Int8 decoder was produced by quantizing the pre-merge decoders separately and re-merging |
| (`merge_decoders(..., strict=False)`); direct quantization of the merged decoder graph does |
| not shrink it (its `If` subgraphs are skipped by onnxruntime's dynamic quantizer). |
|
|