Jarbas commited on
Commit
23f69d1
·
verified ·
1 Parent(s): ab60046

Upload README.md with huggingface_hub

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