ippocode commited on
Commit
1f6243e
·
verified ·
1 Parent(s): 931923e

Update model card for Whisper packs

Browse files
Files changed (1) hide show
  1. README.md +131 -46
README.md CHANGED
@@ -1,52 +1,137 @@
1
- # Indic ASR ONNX
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- On-device ASR for 22 Indian languages using IndicConformer.
4
- Derived from [ai4bharat/indic-conformer-600m-multilingual](https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  ## Structure
7
- core/
8
- ├── encoder.onnx # Shared encoder (1MB)
9
- └── ctc_decoder.onnx # Shared CTC decoder (22MB)
10
- languages/
11
- ├── ta/ # Tamil (~0.1MB)
12
- │ ├── tokens.txt
13
- │ ├── mask.json
14
- │ └── metadata.json
15
- ├── hi/ # Hindi
16
- ├── ml/ # Malayalam
17
- └── ... # All 22 languages
18
-
19
- ## Supported Languages
20
-
21
- | Code | Language | Native |
22
- |------|----------|--------|
23
- | ta | Tamil | தமிழ் |
24
- | hi | Hindi | हिन्दी |
25
- | ml | Malayalam | മലയാളം |
26
- | te | Telugu | తెలుగు |
27
- | kn | Kannada | ಕನ್ನಡ |
28
- | bn | Bengali | বাংলা |
29
- | gu | Gujarati | ગુજરાતી |
30
- | mr | Marathi | मराठी |
31
- | pa | Punjabi | ਪੰਜਾਬੀ |
32
- | or | Odia | ଓଡ଼ିଆ |
33
- | as | Assamese | অসমীয়া |
34
- | ur | Urdu | اردو |
35
- | ne | Nepali | नेपाली |
36
- | sa | Sanskrit | संस्कृतम् |
37
- | mai | Maithili | मैथिली |
38
- | ks | Kashmiri | کٲشُر |
39
- | doi | Dogri | डोगरी |
40
- | kok | Konkani | कोंकणी |
41
- | mni | Manipuri | ꯃꯩꯇꯩꯂꯣꯟ |
42
- | sd | Sindhi | سنڌي |
43
- | sat | Santali | ᱥᱟᱱᱛᱟᱲᱤ |
44
- | brx | Bodo | बर' |
45
-
46
- ## Usage (Android)
47
-
48
- See [github.com/your-org/indic-voice-keyboard](https://github.com/your-org/indic-voice-keyboard)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  ## License
51
 
52
- Apache 2.0 — model weights derived from AI4Bharat's work (MIT).
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - de
6
+ - fr
7
+ - es
8
+ - it
9
+ - pt
10
+ - nl
11
+ - pl
12
+ - ta
13
+ - hi
14
+ - te
15
+ - kn
16
+ - ml
17
+ tags:
18
+ - automatic-speech-recognition
19
+ - whisper
20
+ - sherpa-onnx
21
+ - onnx
22
+ - on-device
23
+ - quantized
24
+ library_name: sherpa-onnx
25
+ pipeline_tag: automatic-speech-recognition
26
+ base_model:
27
+ - openai/whisper-tiny
28
+ - vasista22/whisper-tamil-small
29
+ - vasista22/whisper-hindi-small
30
+ - vasista22/whisper-telugu-tiny
31
+ - vasista22/whisper-kannada-tiny
32
+ - kavyamanohar/whisper-small-malayalam
33
+ ---
34
 
35
+ # indic-asr-onnx
36
+
37
+ INT8-quantized Whisper models in [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx)
38
+ format, packaged for on-device speech recognition.
39
+
40
+ ## Packs
41
+
42
+ Each pack contains `encoder.int8.onnx`, `decoder.int8.onnx`, and `tokens.txt`,
43
+ and is downloaded independently at runtime.
44
+
45
+ | Pack | Languages | Size | Source model |
46
+ |---|---|---|---|
47
+ | `whisper-tiny` | en, de, fr, es, it, pt, nl, pl (+90 more) | 99 MB | [openai/whisper-tiny](https://huggingface.co/openai/whisper-tiny) |
48
+ | `whisper-small-ta` | Tamil | 358 MB | [vasista22/whisper-tamil-small](https://huggingface.co/vasista22/whisper-tamil-small) |
49
+ | `whisper-small-hi` | Hindi | 358 MB | [vasista22/whisper-hindi-small](https://huggingface.co/vasista22/whisper-hindi-small) |
50
+ | `whisper-small-ml` | Malayalam | 358 MB | [kavyamanohar/whisper-small-malayalam](https://huggingface.co/kavyamanohar/whisper-small-malayalam) |
51
+ | `whisper-tiny-te` | Telugu | 99 MB | [vasista22/whisper-telugu-tiny](https://huggingface.co/vasista22/whisper-telugu-tiny) |
52
+ | `whisper-tiny-kn` | Kannada | 99 MB | [vasista22/whisper-kannada-tiny](https://huggingface.co/vasista22/whisper-kannada-tiny) |
53
+
54
+ `whisper-tiny` is the multilingual base model — it serves all European languages
55
+ from a single download. The Indic packs are language-specific fine-tunes, which
56
+ substantially outperform stock Whisper on those languages.
57
 
58
  ## Structure
59
+
60
+ ```
61
+ models/
62
+ ├── whisper-tiny/
63
+ │ ├── encoder.int8.onnx
64
+ │ ├── decoder.int8.onnx
65
+ │ └── tokens.txt
66
+ ├── whisper-small-ta/
67
+ ├── whisper-small-hi/
68
+ ├── whisper-small-ml/
69
+ ├── whisper-tiny-te/
70
+ └── whisper-tiny-kn/
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ### Python (sherpa-onnx)
76
+
77
+ ```python
78
+ import sherpa_onnx
79
+
80
+ recognizer = sherpa_onnx.OfflineRecognizer.from_whisper(
81
+ encoder="models/whisper-small-ta/encoder.int8.onnx",
82
+ decoder="models/whisper-small-ta/decoder.int8.onnx",
83
+ tokens="models/whisper-small-ta/tokens.txt",
84
+ language="ta",
85
+ task="transcribe",
86
+ num_threads=2,
87
+ )
88
+
89
+ stream = recognizer.create_stream()
90
+ stream.accept_waveform(16000, samples) # float32 PCM, 16 kHz mono
91
+ recognizer.decode_stream(stream)
92
+ print(stream.result.text)
93
+ ```
94
+
95
+ ### Android (Kotlin)
96
+
97
+ ```kotlin
98
+ val config = OfflineRecognizerConfig(
99
+ featConfig = FeatureConfig(sampleRate = 16000, featureDim = 80),
100
+ modelConfig = OfflineModelConfig(
101
+ whisper = OfflineWhisperModelConfig(
102
+ encoder = "$packDir/encoder.int8.onnx",
103
+ decoder = "$packDir/decoder.int8.onnx",
104
+ language = "ta",
105
+ task = "transcribe",
106
+ ),
107
+ tokens = "$packDir/tokens.txt",
108
+ numThreads = 2,
109
+ )
110
+ )
111
+ val recognizer = OfflineRecognizer(config)
112
+ ```
113
+
114
+ ## Export
115
+
116
+ Exported with sherpa-onnx's
117
+ [`scripts/whisper/export-onnx.py`](https://github.com/k2-fsa/sherpa-onnx/blob/master/scripts/whisper/export-onnx.py),
118
+ then dynamically quantized to INT8.
119
+
120
+ HuggingFace fine-tunes were first converted to OpenAI Whisper checkpoint format
121
+ (`{"dims": ..., "model_state_dict": ...}`) so the export script could load them.
122
+
123
+ Note: on PyTorch ≥ 2.9 the export script requires `dynamo=False` to be passed to
124
+ `torch.onnx.export` — the dynamo-based exporter fails on Whisper's
125
+ data-dependent positional embedding indexing.
126
+
127
+ ## Credits
128
+
129
+ - Fine-tuned Indic models by **[vasista22](https://huggingface.co/vasista22)**
130
+ (Speech Lab, IIT Madras — funded by Bhashini, MeitY, Govt. of India) and
131
+ **[kavyamanohar](https://huggingface.co/kavyamanohar)**
132
+ - Base models by **OpenAI** ([Whisper](https://github.com/openai/whisper))
133
+ - Export tooling by **[k2-fsa](https://github.com/k2-fsa)** (sherpa-onnx)
134
 
135
  ## License
136
 
137
+ Apache 2.0, inherited from the upstream models.