burakaydinofficial commited on
Commit
41c9bfc
·
verified ·
1 Parent(s): 1924fd6

Release whisper-base-mla-cv11: on-device tier of the MLA-Whisper family

Browse files
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: openai/whisper-base
4
+ datasets:
5
+ - burakaydinofficial/Whispered
6
+ language: [en, de, es, fr, ru, tr, cy, ar, ka, th, zh]
7
+ pipeline_tag: automatic-speech-recognition
8
+ library_name: transformers
9
+ tags: [whisper, mla, multi-head-latent-attention, kv-cache-compression, speech-recognition, multilingual]
10
+ ---
11
+
12
+ # Whisper-Base-MLA (11 languages) — MLA-converted, 62.5% smaller decode KV-cache
13
+
14
+ The on-device-tier sibling of the WhisperMLA family: `openai/whisper-base` (74M) with its
15
+ decoder self-attention converted MHA→MLA (per [Whisper-MLA, arXiv:2603.00563](https://arxiv.org/abs/2603.00563)),
16
+ recovery-fine-tuned on 11 languages of the CC0
17
+ [Whispered](https://huggingface.co/datasets/burakaydinofficial/Whispered) corpus (32k clips/lang).
18
+
19
+ ```python
20
+ from transformers import AutoModelForSpeechSeq2Seq
21
+ model = AutoModelForSpeechSeq2Seq.from_pretrained("burakaydinofficial/whisper-base-mla-cv11", trust_remote_code=True) # transformers==4.46.x
22
+ ```
23
+
24
+ ## Honest sizing note (read this first)
25
+ **Conversion cost grows as the student shrinks** — measured across the family: small ≈ +0.4
26
+ median WER → base ≈ +1.0 → tiny ≈ +1.9. At the base tier you pay ≈ +1.0 WER (median) for the
27
+ 62.5% cache cut. If quality is the priority, prefer the `small` variant; this tier is for
28
+ memory-constrained deployments where the cache cut matters most.
29
+
30
+ ## Results (CommonVoice-17 test, n=1500/lang; WER/CER %; cost = paired vs an identically-trained unconverted control)
31
+
32
+ | Lang | this model (WER / CER) | conversion cost |
33
+ |---|---|---|
34
+ | en | 21.1 / 11.2 | +1.04 ✱ |
35
+ | de | 30.1 / 11.3 | +0.83 (ns) |
36
+ | es | 19.0 / 6.7 | +0.88 ✱ |
37
+ | fr | 32.3 / 13.9 | +0.59 (ns) |
38
+ | ru | 28.8 / 8.7 | +1.31 ✱ |
39
+ | tr | 38.9 / 11.8 | +1.13 ✱ |
40
+ | cy | 79.9 / 34.2 | +2.10 ✱ |
41
+ | ar | 58.9 / 24.5 | +2.71 ✱ |
42
+ | th | 51.7 / 20.3 | +0.22 CER (ns) |
43
+ | zh | 91.7 / 25.4 | −0.23 CER (ns) |
44
+ | ka | 111.8 / 75.8 | +12.74 ✱ — floor |
45
+
46
+ Absolute quality is base-tier-typical (much lower than `small` — that is the base model, not
47
+ MLA). Encoder frozen both arms; 15,000 steps; warmup+cosine; fp16.
48
+
49
+ ## Limitations
50
+ Same as the flagship: transformers==4.46.x + trust_remote_code required; not loadable in
51
+ whisper.cpp/faster-whisper/CT2; coverage = these 11 languages (unseen scripts degrade);
52
+ ka reported as the labeled model-class floor; read-speech domain.
53
+
54
+ ## Acoustic conditions of the evaluation
55
+ Evaluated on crowdsourced **consumer-microphone recordings with real environmental noise** —
56
+ traffic, room reverb, variable devices — CommonVoice's native conditions, not studio audio.
57
+ The numbers above already include that heterogeneity. Not yet benchmarked: far-field, telephony
58
+ (8 kHz), overlapping speech; an SNR-ladder robustness section will be added when measured.
added_tokens.json ADDED
@@ -0,0 +1,1609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|0.00|>": 50364,
3
+ "<|0.02|>": 50365,
4
+ "<|0.04|>": 50366,
5
+ "<|0.06|>": 50367,
6
+ "<|0.08|>": 50368,
7
+ "<|0.10|>": 50369,
8
+ "<|0.12|>": 50370,
9
+ "<|0.14|>": 50371,
10
+ "<|0.16|>": 50372,
11
+ "<|0.18|>": 50373,
12
+ "<|0.20|>": 50374,
13
+ "<|0.22|>": 50375,
14
+ "<|0.24|>": 50376,
15
+ "<|0.26|>": 50377,
16
+ "<|0.28|>": 50378,
17
+ "<|0.30|>": 50379,
18
+ "<|0.32|>": 50380,
19
+ "<|0.34|>": 50381,
20
+ "<|0.36|>": 50382,
21
+ "<|0.38|>": 50383,
22
+ "<|0.40|>": 50384,
23
+ "<|0.42|>": 50385,
24
+ "<|0.44|>": 50386,
25
+ "<|0.46|>": 50387,
26
+ "<|0.48|>": 50388,
27
+ "<|0.50|>": 50389,
28
+ "<|0.52|>": 50390,
29
+ "<|0.54|>": 50391,
30
+ "<|0.56|>": 50392,
31
+ "<|0.58|>": 50393,
32
+ "<|0.60|>": 50394,
33
+ "<|0.62|>": 50395,
34
+ "<|0.64|>": 50396,
35
+ "<|0.66|>": 50397,
36
+ "<|0.68|>": 50398,
37
+ "<|0.70|>": 50399,
38
+ "<|0.72|>": 50400,
39
+ "<|0.74|>": 50401,
40
+ "<|0.76|>": 50402,
41
+ "<|0.78|>": 50403,
42
+ "<|0.80|>": 50404,
43
+ "<|0.82|>": 50405,
44
+ "<|0.84|>": 50406,
45
+ "<|0.86|>": 50407,
46
+ "<|0.88|>": 50408,
47
+ "<|0.90|>": 50409,
48
+ "<|0.92|>": 50410,
49
+ "<|0.94|>": 50411,
50
+ "<|0.96|>": 50412,
51
+ "<|0.98|>": 50413,
52
+ "<|1.00|>": 50414,
53
+ "<|1.02|>": 50415,
54
+ "<|1.04|>": 50416,
55
+ "<|1.06|>": 50417,
56
+ "<|1.08|>": 50418,
57
+ "<|1.10|>": 50419,
58
+ "<|1.12|>": 50420,
59
+ "<|1.14|>": 50421,
60
+ "<|1.16|>": 50422,
61
+ "<|1.18|>": 50423,
62
+ "<|1.20|>": 50424,
63
+ "<|1.22|>": 50425,
64
+ "<|1.24|>": 50426,
65
+ "<|1.26|>": 50427,
66
+ "<|1.28|>": 50428,
67
+ "<|1.30|>": 50429,
68
+ "<|1.32|>": 50430,
69
+ "<|1.34|>": 50431,
70
+ "<|1.36|>": 50432,
71
+ "<|1.38|>": 50433,
72
+ "<|1.40|>": 50434,
73
+ "<|1.42|>": 50435,
74
+ "<|1.44|>": 50436,
75
+ "<|1.46|>": 50437,
76
+ "<|1.48|>": 50438,
77
+ "<|1.50|>": 50439,
78
+ "<|1.52|>": 50440,
79
+ "<|1.54|>": 50441,
80
+ "<|1.56|>": 50442,
81
+ "<|1.58|>": 50443,
82
+ "<|1.60|>": 50444,
83
+ "<|1.62|>": 50445,
84
+ "<|1.64|>": 50446,
85
+ "<|1.66|>": 50447,
86
+ "<|1.68|>": 50448,
87
+ "<|1.70|>": 50449,
88
+ "<|1.72|>": 50450,
89
+ "<|1.74|>": 50451,
90
+ "<|1.76|>": 50452,
91
+ "<|1.78|>": 50453,
92
+ "<|1.80|>": 50454,
93
+ "<|1.82|>": 50455,
94
+ "<|1.84|>": 50456,
95
+ "<|1.86|>": 50457,
96
+ "<|1.88|>": 50458,
97
+ "<|1.90|>": 50459,
98
+ "<|1.92|>": 50460,
99
+ "<|1.94|>": 50461,
100
+ "<|1.96|>": 50462,
101
+ "<|1.98|>": 50463,
102
+ "<|10.00|>": 50864,
103
+ "<|10.02|>": 50865,
104
+ "<|10.04|>": 50866,
105
+ "<|10.06|>": 50867,
106
+ "<|10.08|>": 50868,
107
+ "<|10.10|>": 50869,
108
+ "<|10.12|>": 50870,
109
+ "<|10.14|>": 50871,
110
+ "<|10.16|>": 50872,
111
+ "<|10.18|>": 50873,
112
+ "<|10.20|>": 50874,
113
+ "<|10.22|>": 50875,
114
+ "<|10.24|>": 50876,
115
+ "<|10.26|>": 50877,
116
+ "<|10.28|>": 50878,
117
+ "<|10.30|>": 50879,
118
+ "<|10.32|>": 50880,
119
+ "<|10.34|>": 50881,
120
+ "<|10.36|>": 50882,
121
+ "<|10.38|>": 50883,
122
+ "<|10.40|>": 50884,
123
+ "<|10.42|>": 50885,
124
+ "<|10.44|>": 50886,
125
+ "<|10.46|>": 50887,
126
+ "<|10.48|>": 50888,
127
+ "<|10.50|>": 50889,
128
+ "<|10.52|>": 50890,
129
+ "<|10.54|>": 50891,
130
+ "<|10.56|>": 50892,
131
+ "<|10.58|>": 50893,
132
+ "<|10.60|>": 50894,
133
+ "<|10.62|>": 50895,
134
+ "<|10.64|>": 50896,
135
+ "<|10.66|>": 50897,
136
+ "<|10.68|>": 50898,
137
+ "<|10.70|>": 50899,
138
+ "<|10.72|>": 50900,
139
+ "<|10.74|>": 50901,
140
+ "<|10.76|>": 50902,
141
+ "<|10.78|>": 50903,
142
+ "<|10.80|>": 50904,
143
+ "<|10.82|>": 50905,
144
+ "<|10.84|>": 50906,
145
+ "<|10.86|>": 50907,
146
+ "<|10.88|>": 50908,
147
+ "<|10.90|>": 50909,
148
+ "<|10.92|>": 50910,
149
+ "<|10.94|>": 50911,
150
+ "<|10.96|>": 50912,
151
+ "<|10.98|>": 50913,
152
+ "<|11.00|>": 50914,
153
+ "<|11.02|>": 50915,
154
+ "<|11.04|>": 50916,
155
+ "<|11.06|>": 50917,
156
+ "<|11.08|>": 50918,
157
+ "<|11.10|>": 50919,
158
+ "<|11.12|>": 50920,
159
+ "<|11.14|>": 50921,
160
+ "<|11.16|>": 50922,
161
+ "<|11.18|>": 50923,
162
+ "<|11.20|>": 50924,
163
+ "<|11.22|>": 50925,
164
+ "<|11.24|>": 50926,
165
+ "<|11.26|>": 50927,
166
+ "<|11.28|>": 50928,
167
+ "<|11.30|>": 50929,
168
+ "<|11.32|>": 50930,
169
+ "<|11.34|>": 50931,
170
+ "<|11.36|>": 50932,
171
+ "<|11.38|>": 50933,
172
+ "<|11.40|>": 50934,
173
+ "<|11.42|>": 50935,
174
+ "<|11.44|>": 50936,
175
+ "<|11.46|>": 50937,
176
+ "<|11.48|>": 50938,
177
+ "<|11.50|>": 50939,
178
+ "<|11.52|>": 50940,
179
+ "<|11.54|>": 50941,
180
+ "<|11.56|>": 50942,
181
+ "<|11.58|>": 50943,
182
+ "<|11.60|>": 50944,
183
+ "<|11.62|>": 50945,
184
+ "<|11.64|>": 50946,
185
+ "<|11.66|>": 50947,
186
+ "<|11.68|>": 50948,
187
+ "<|11.70|>": 50949,
188
+ "<|11.72|>": 50950,
189
+ "<|11.74|>": 50951,
190
+ "<|11.76|>": 50952,
191
+ "<|11.78|>": 50953,
192
+ "<|11.80|>": 50954,
193
+ "<|11.82|>": 50955,
194
+ "<|11.84|>": 50956,
195
+ "<|11.86|>": 50957,
196
+ "<|11.88|>": 50958,
197
+ "<|11.90|>": 50959,
198
+ "<|11.92|>": 50960,
199
+ "<|11.94|>": 50961,
200
+ "<|11.96|>": 50962,
201
+ "<|11.98|>": 50963,
202
+ "<|12.00|>": 50964,
203
+ "<|12.02|>": 50965,
204
+ "<|12.04|>": 50966,
205
+ "<|12.06|>": 50967,
206
+ "<|12.08|>": 50968,
207
+ "<|12.10|>": 50969,
208
+ "<|12.12|>": 50970,
209
+ "<|12.14|>": 50971,
210
+ "<|12.16|>": 50972,
211
+ "<|12.18|>": 50973,
212
+ "<|12.20|>": 50974,
213
+ "<|12.22|>": 50975,
214
+ "<|12.24|>": 50976,
215
+ "<|12.26|>": 50977,
216
+ "<|12.28|>": 50978,
217
+ "<|12.30|>": 50979,
218
+ "<|12.32|>": 50980,
219
+ "<|12.34|>": 50981,
220
+ "<|12.36|>": 50982,
221
+ "<|12.38|>": 50983,
222
+ "<|12.40|>": 50984,
223
+ "<|12.42|>": 50985,
224
+ "<|12.44|>": 50986,
225
+ "<|12.46|>": 50987,
226
+ "<|12.48|>": 50988,
227
+ "<|12.50|>": 50989,
228
+ "<|12.52|>": 50990,
229
+ "<|12.54|>": 50991,
230
+ "<|12.56|>": 50992,
231
+ "<|12.58|>": 50993,
232
+ "<|12.60|>": 50994,
233
+ "<|12.62|>": 50995,
234
+ "<|12.64|>": 50996,
235
+ "<|12.66|>": 50997,
236
+ "<|12.68|>": 50998,
237
+ "<|12.70|>": 50999,
238
+ "<|12.72|>": 51000,
239
+ "<|12.74|>": 51001,
240
+ "<|12.76|>": 51002,
241
+ "<|12.78|>": 51003,
242
+ "<|12.80|>": 51004,
243
+ "<|12.82|>": 51005,
244
+ "<|12.84|>": 51006,
245
+ "<|12.86|>": 51007,
246
+ "<|12.88|>": 51008,
247
+ "<|12.90|>": 51009,
248
+ "<|12.92|>": 51010,
249
+ "<|12.94|>": 51011,
250
+ "<|12.96|>": 51012,
251
+ "<|12.98|>": 51013,
252
+ "<|13.00|>": 51014,
253
+ "<|13.02|>": 51015,
254
+ "<|13.04|>": 51016,
255
+ "<|13.06|>": 51017,
256
+ "<|13.08|>": 51018,
257
+ "<|13.10|>": 51019,
258
+ "<|13.12|>": 51020,
259
+ "<|13.14|>": 51021,
260
+ "<|13.16|>": 51022,
261
+ "<|13.18|>": 51023,
262
+ "<|13.20|>": 51024,
263
+ "<|13.22|>": 51025,
264
+ "<|13.24|>": 51026,
265
+ "<|13.26|>": 51027,
266
+ "<|13.28|>": 51028,
267
+ "<|13.30|>": 51029,
268
+ "<|13.32|>": 51030,
269
+ "<|13.34|>": 51031,
270
+ "<|13.36|>": 51032,
271
+ "<|13.38|>": 51033,
272
+ "<|13.40|>": 51034,
273
+ "<|13.42|>": 51035,
274
+ "<|13.44|>": 51036,
275
+ "<|13.46|>": 51037,
276
+ "<|13.48|>": 51038,
277
+ "<|13.50|>": 51039,
278
+ "<|13.52|>": 51040,
279
+ "<|13.54|>": 51041,
280
+ "<|13.56|>": 51042,
281
+ "<|13.58|>": 51043,
282
+ "<|13.60|>": 51044,
283
+ "<|13.62|>": 51045,
284
+ "<|13.64|>": 51046,
285
+ "<|13.66|>": 51047,
286
+ "<|13.68|>": 51048,
287
+ "<|13.70|>": 51049,
288
+ "<|13.72|>": 51050,
289
+ "<|13.74|>": 51051,
290
+ "<|13.76|>": 51052,
291
+ "<|13.78|>": 51053,
292
+ "<|13.80|>": 51054,
293
+ "<|13.82|>": 51055,
294
+ "<|13.84|>": 51056,
295
+ "<|13.86|>": 51057,
296
+ "<|13.88|>": 51058,
297
+ "<|13.90|>": 51059,
298
+ "<|13.92|>": 51060,
299
+ "<|13.94|>": 51061,
300
+ "<|13.96|>": 51062,
301
+ "<|13.98|>": 51063,
302
+ "<|14.00|>": 51064,
303
+ "<|14.02|>": 51065,
304
+ "<|14.04|>": 51066,
305
+ "<|14.06|>": 51067,
306
+ "<|14.08|>": 51068,
307
+ "<|14.10|>": 51069,
308
+ "<|14.12|>": 51070,
309
+ "<|14.14|>": 51071,
310
+ "<|14.16|>": 51072,
311
+ "<|14.18|>": 51073,
312
+ "<|14.20|>": 51074,
313
+ "<|14.22|>": 51075,
314
+ "<|14.24|>": 51076,
315
+ "<|14.26|>": 51077,
316
+ "<|14.28|>": 51078,
317
+ "<|14.30|>": 51079,
318
+ "<|14.32|>": 51080,
319
+ "<|14.34|>": 51081,
320
+ "<|14.36|>": 51082,
321
+ "<|14.38|>": 51083,
322
+ "<|14.40|>": 51084,
323
+ "<|14.42|>": 51085,
324
+ "<|14.44|>": 51086,
325
+ "<|14.46|>": 51087,
326
+ "<|14.48|>": 51088,
327
+ "<|14.50|>": 51089,
328
+ "<|14.52|>": 51090,
329
+ "<|14.54|>": 51091,
330
+ "<|14.56|>": 51092,
331
+ "<|14.58|>": 51093,
332
+ "<|14.60|>": 51094,
333
+ "<|14.62|>": 51095,
334
+ "<|14.64|>": 51096,
335
+ "<|14.66|>": 51097,
336
+ "<|14.68|>": 51098,
337
+ "<|14.70|>": 51099,
338
+ "<|14.72|>": 51100,
339
+ "<|14.74|>": 51101,
340
+ "<|14.76|>": 51102,
341
+ "<|14.78|>": 51103,
342
+ "<|14.80|>": 51104,
343
+ "<|14.82|>": 51105,
344
+ "<|14.84|>": 51106,
345
+ "<|14.86|>": 51107,
346
+ "<|14.88|>": 51108,
347
+ "<|14.90|>": 51109,
348
+ "<|14.92|>": 51110,
349
+ "<|14.94|>": 51111,
350
+ "<|14.96|>": 51112,
351
+ "<|14.98|>": 51113,
352
+ "<|15.00|>": 51114,
353
+ "<|15.02|>": 51115,
354
+ "<|15.04|>": 51116,
355
+ "<|15.06|>": 51117,
356
+ "<|15.08|>": 51118,
357
+ "<|15.10|>": 51119,
358
+ "<|15.12|>": 51120,
359
+ "<|15.14|>": 51121,
360
+ "<|15.16|>": 51122,
361
+ "<|15.18|>": 51123,
362
+ "<|15.20|>": 51124,
363
+ "<|15.22|>": 51125,
364
+ "<|15.24|>": 51126,
365
+ "<|15.26|>": 51127,
366
+ "<|15.28|>": 51128,
367
+ "<|15.30|>": 51129,
368
+ "<|15.32|>": 51130,
369
+ "<|15.34|>": 51131,
370
+ "<|15.36|>": 51132,
371
+ "<|15.38|>": 51133,
372
+ "<|15.40|>": 51134,
373
+ "<|15.42|>": 51135,
374
+ "<|15.44|>": 51136,
375
+ "<|15.46|>": 51137,
376
+ "<|15.48|>": 51138,
377
+ "<|15.50|>": 51139,
378
+ "<|15.52|>": 51140,
379
+ "<|15.54|>": 51141,
380
+ "<|15.56|>": 51142,
381
+ "<|15.58|>": 51143,
382
+ "<|15.60|>": 51144,
383
+ "<|15.62|>": 51145,
384
+ "<|15.64|>": 51146,
385
+ "<|15.66|>": 51147,
386
+ "<|15.68|>": 51148,
387
+ "<|15.70|>": 51149,
388
+ "<|15.72|>": 51150,
389
+ "<|15.74|>": 51151,
390
+ "<|15.76|>": 51152,
391
+ "<|15.78|>": 51153,
392
+ "<|15.80|>": 51154,
393
+ "<|15.82|>": 51155,
394
+ "<|15.84|>": 51156,
395
+ "<|15.86|>": 51157,
396
+ "<|15.88|>": 51158,
397
+ "<|15.90|>": 51159,
398
+ "<|15.92|>": 51160,
399
+ "<|15.94|>": 51161,
400
+ "<|15.96|>": 51162,
401
+ "<|15.98|>": 51163,
402
+ "<|16.00|>": 51164,
403
+ "<|16.02|>": 51165,
404
+ "<|16.04|>": 51166,
405
+ "<|16.06|>": 51167,
406
+ "<|16.08|>": 51168,
407
+ "<|16.10|>": 51169,
408
+ "<|16.12|>": 51170,
409
+ "<|16.14|>": 51171,
410
+ "<|16.16|>": 51172,
411
+ "<|16.18|>": 51173,
412
+ "<|16.20|>": 51174,
413
+ "<|16.22|>": 51175,
414
+ "<|16.24|>": 51176,
415
+ "<|16.26|>": 51177,
416
+ "<|16.28|>": 51178,
417
+ "<|16.30|>": 51179,
418
+ "<|16.32|>": 51180,
419
+ "<|16.34|>": 51181,
420
+ "<|16.36|>": 51182,
421
+ "<|16.38|>": 51183,
422
+ "<|16.40|>": 51184,
423
+ "<|16.42|>": 51185,
424
+ "<|16.44|>": 51186,
425
+ "<|16.46|>": 51187,
426
+ "<|16.48|>": 51188,
427
+ "<|16.50|>": 51189,
428
+ "<|16.52|>": 51190,
429
+ "<|16.54|>": 51191,
430
+ "<|16.56|>": 51192,
431
+ "<|16.58|>": 51193,
432
+ "<|16.60|>": 51194,
433
+ "<|16.62|>": 51195,
434
+ "<|16.64|>": 51196,
435
+ "<|16.66|>": 51197,
436
+ "<|16.68|>": 51198,
437
+ "<|16.70|>": 51199,
438
+ "<|16.72|>": 51200,
439
+ "<|16.74|>": 51201,
440
+ "<|16.76|>": 51202,
441
+ "<|16.78|>": 51203,
442
+ "<|16.80|>": 51204,
443
+ "<|16.82|>": 51205,
444
+ "<|16.84|>": 51206,
445
+ "<|16.86|>": 51207,
446
+ "<|16.88|>": 51208,
447
+ "<|16.90|>": 51209,
448
+ "<|16.92|>": 51210,
449
+ "<|16.94|>": 51211,
450
+ "<|16.96|>": 51212,
451
+ "<|16.98|>": 51213,
452
+ "<|17.00|>": 51214,
453
+ "<|17.02|>": 51215,
454
+ "<|17.04|>": 51216,
455
+ "<|17.06|>": 51217,
456
+ "<|17.08|>": 51218,
457
+ "<|17.10|>": 51219,
458
+ "<|17.12|>": 51220,
459
+ "<|17.14|>": 51221,
460
+ "<|17.16|>": 51222,
461
+ "<|17.18|>": 51223,
462
+ "<|17.20|>": 51224,
463
+ "<|17.22|>": 51225,
464
+ "<|17.24|>": 51226,
465
+ "<|17.26|>": 51227,
466
+ "<|17.28|>": 51228,
467
+ "<|17.30|>": 51229,
468
+ "<|17.32|>": 51230,
469
+ "<|17.34|>": 51231,
470
+ "<|17.36|>": 51232,
471
+ "<|17.38|>": 51233,
472
+ "<|17.40|>": 51234,
473
+ "<|17.42|>": 51235,
474
+ "<|17.44|>": 51236,
475
+ "<|17.46|>": 51237,
476
+ "<|17.48|>": 51238,
477
+ "<|17.50|>": 51239,
478
+ "<|17.52|>": 51240,
479
+ "<|17.54|>": 51241,
480
+ "<|17.56|>": 51242,
481
+ "<|17.58|>": 51243,
482
+ "<|17.60|>": 51244,
483
+ "<|17.62|>": 51245,
484
+ "<|17.64|>": 51246,
485
+ "<|17.66|>": 51247,
486
+ "<|17.68|>": 51248,
487
+ "<|17.70|>": 51249,
488
+ "<|17.72|>": 51250,
489
+ "<|17.74|>": 51251,
490
+ "<|17.76|>": 51252,
491
+ "<|17.78|>": 51253,
492
+ "<|17.80|>": 51254,
493
+ "<|17.82|>": 51255,
494
+ "<|17.84|>": 51256,
495
+ "<|17.86|>": 51257,
496
+ "<|17.88|>": 51258,
497
+ "<|17.90|>": 51259,
498
+ "<|17.92|>": 51260,
499
+ "<|17.94|>": 51261,
500
+ "<|17.96|>": 51262,
501
+ "<|17.98|>": 51263,
502
+ "<|18.00|>": 51264,
503
+ "<|18.02|>": 51265,
504
+ "<|18.04|>": 51266,
505
+ "<|18.06|>": 51267,
506
+ "<|18.08|>": 51268,
507
+ "<|18.10|>": 51269,
508
+ "<|18.12|>": 51270,
509
+ "<|18.14|>": 51271,
510
+ "<|18.16|>": 51272,
511
+ "<|18.18|>": 51273,
512
+ "<|18.20|>": 51274,
513
+ "<|18.22|>": 51275,
514
+ "<|18.24|>": 51276,
515
+ "<|18.26|>": 51277,
516
+ "<|18.28|>": 51278,
517
+ "<|18.30|>": 51279,
518
+ "<|18.32|>": 51280,
519
+ "<|18.34|>": 51281,
520
+ "<|18.36|>": 51282,
521
+ "<|18.38|>": 51283,
522
+ "<|18.40|>": 51284,
523
+ "<|18.42|>": 51285,
524
+ "<|18.44|>": 51286,
525
+ "<|18.46|>": 51287,
526
+ "<|18.48|>": 51288,
527
+ "<|18.50|>": 51289,
528
+ "<|18.52|>": 51290,
529
+ "<|18.54|>": 51291,
530
+ "<|18.56|>": 51292,
531
+ "<|18.58|>": 51293,
532
+ "<|18.60|>": 51294,
533
+ "<|18.62|>": 51295,
534
+ "<|18.64|>": 51296,
535
+ "<|18.66|>": 51297,
536
+ "<|18.68|>": 51298,
537
+ "<|18.70|>": 51299,
538
+ "<|18.72|>": 51300,
539
+ "<|18.74|>": 51301,
540
+ "<|18.76|>": 51302,
541
+ "<|18.78|>": 51303,
542
+ "<|18.80|>": 51304,
543
+ "<|18.82|>": 51305,
544
+ "<|18.84|>": 51306,
545
+ "<|18.86|>": 51307,
546
+ "<|18.88|>": 51308,
547
+ "<|18.90|>": 51309,
548
+ "<|18.92|>": 51310,
549
+ "<|18.94|>": 51311,
550
+ "<|18.96|>": 51312,
551
+ "<|18.98|>": 51313,
552
+ "<|19.00|>": 51314,
553
+ "<|19.02|>": 51315,
554
+ "<|19.04|>": 51316,
555
+ "<|19.06|>": 51317,
556
+ "<|19.08|>": 51318,
557
+ "<|19.10|>": 51319,
558
+ "<|19.12|>": 51320,
559
+ "<|19.14|>": 51321,
560
+ "<|19.16|>": 51322,
561
+ "<|19.18|>": 51323,
562
+ "<|19.20|>": 51324,
563
+ "<|19.22|>": 51325,
564
+ "<|19.24|>": 51326,
565
+ "<|19.26|>": 51327,
566
+ "<|19.28|>": 51328,
567
+ "<|19.30|>": 51329,
568
+ "<|19.32|>": 51330,
569
+ "<|19.34|>": 51331,
570
+ "<|19.36|>": 51332,
571
+ "<|19.38|>": 51333,
572
+ "<|19.40|>": 51334,
573
+ "<|19.42|>": 51335,
574
+ "<|19.44|>": 51336,
575
+ "<|19.46|>": 51337,
576
+ "<|19.48|>": 51338,
577
+ "<|19.50|>": 51339,
578
+ "<|19.52|>": 51340,
579
+ "<|19.54|>": 51341,
580
+ "<|19.56|>": 51342,
581
+ "<|19.58|>": 51343,
582
+ "<|19.60|>": 51344,
583
+ "<|19.62|>": 51345,
584
+ "<|19.64|>": 51346,
585
+ "<|19.66|>": 51347,
586
+ "<|19.68|>": 51348,
587
+ "<|19.70|>": 51349,
588
+ "<|19.72|>": 51350,
589
+ "<|19.74|>": 51351,
590
+ "<|19.76|>": 51352,
591
+ "<|19.78|>": 51353,
592
+ "<|19.80|>": 51354,
593
+ "<|19.82|>": 51355,
594
+ "<|19.84|>": 51356,
595
+ "<|19.86|>": 51357,
596
+ "<|19.88|>": 51358,
597
+ "<|19.90|>": 51359,
598
+ "<|19.92|>": 51360,
599
+ "<|19.94|>": 51361,
600
+ "<|19.96|>": 51362,
601
+ "<|19.98|>": 51363,
602
+ "<|2.00|>": 50464,
603
+ "<|2.02|>": 50465,
604
+ "<|2.04|>": 50466,
605
+ "<|2.06|>": 50467,
606
+ "<|2.08|>": 50468,
607
+ "<|2.10|>": 50469,
608
+ "<|2.12|>": 50470,
609
+ "<|2.14|>": 50471,
610
+ "<|2.16|>": 50472,
611
+ "<|2.18|>": 50473,
612
+ "<|2.20|>": 50474,
613
+ "<|2.22|>": 50475,
614
+ "<|2.24|>": 50476,
615
+ "<|2.26|>": 50477,
616
+ "<|2.28|>": 50478,
617
+ "<|2.30|>": 50479,
618
+ "<|2.32|>": 50480,
619
+ "<|2.34|>": 50481,
620
+ "<|2.36|>": 50482,
621
+ "<|2.38|>": 50483,
622
+ "<|2.40|>": 50484,
623
+ "<|2.42|>": 50485,
624
+ "<|2.44|>": 50486,
625
+ "<|2.46|>": 50487,
626
+ "<|2.48|>": 50488,
627
+ "<|2.50|>": 50489,
628
+ "<|2.52|>": 50490,
629
+ "<|2.54|>": 50491,
630
+ "<|2.56|>": 50492,
631
+ "<|2.58|>": 50493,
632
+ "<|2.60|>": 50494,
633
+ "<|2.62|>": 50495,
634
+ "<|2.64|>": 50496,
635
+ "<|2.66|>": 50497,
636
+ "<|2.68|>": 50498,
637
+ "<|2.70|>": 50499,
638
+ "<|2.72|>": 50500,
639
+ "<|2.74|>": 50501,
640
+ "<|2.76|>": 50502,
641
+ "<|2.78|>": 50503,
642
+ "<|2.80|>": 50504,
643
+ "<|2.82|>": 50505,
644
+ "<|2.84|>": 50506,
645
+ "<|2.86|>": 50507,
646
+ "<|2.88|>": 50508,
647
+ "<|2.90|>": 50509,
648
+ "<|2.92|>": 50510,
649
+ "<|2.94|>": 50511,
650
+ "<|2.96|>": 50512,
651
+ "<|2.98|>": 50513,
652
+ "<|20.00|>": 51364,
653
+ "<|20.02|>": 51365,
654
+ "<|20.04|>": 51366,
655
+ "<|20.06|>": 51367,
656
+ "<|20.08|>": 51368,
657
+ "<|20.10|>": 51369,
658
+ "<|20.12|>": 51370,
659
+ "<|20.14|>": 51371,
660
+ "<|20.16|>": 51372,
661
+ "<|20.18|>": 51373,
662
+ "<|20.20|>": 51374,
663
+ "<|20.22|>": 51375,
664
+ "<|20.24|>": 51376,
665
+ "<|20.26|>": 51377,
666
+ "<|20.28|>": 51378,
667
+ "<|20.30|>": 51379,
668
+ "<|20.32|>": 51380,
669
+ "<|20.34|>": 51381,
670
+ "<|20.36|>": 51382,
671
+ "<|20.38|>": 51383,
672
+ "<|20.40|>": 51384,
673
+ "<|20.42|>": 51385,
674
+ "<|20.44|>": 51386,
675
+ "<|20.46|>": 51387,
676
+ "<|20.48|>": 51388,
677
+ "<|20.50|>": 51389,
678
+ "<|20.52|>": 51390,
679
+ "<|20.54|>": 51391,
680
+ "<|20.56|>": 51392,
681
+ "<|20.58|>": 51393,
682
+ "<|20.60|>": 51394,
683
+ "<|20.62|>": 51395,
684
+ "<|20.64|>": 51396,
685
+ "<|20.66|>": 51397,
686
+ "<|20.68|>": 51398,
687
+ "<|20.70|>": 51399,
688
+ "<|20.72|>": 51400,
689
+ "<|20.74|>": 51401,
690
+ "<|20.76|>": 51402,
691
+ "<|20.78|>": 51403,
692
+ "<|20.80|>": 51404,
693
+ "<|20.82|>": 51405,
694
+ "<|20.84|>": 51406,
695
+ "<|20.86|>": 51407,
696
+ "<|20.88|>": 51408,
697
+ "<|20.90|>": 51409,
698
+ "<|20.92|>": 51410,
699
+ "<|20.94|>": 51411,
700
+ "<|20.96|>": 51412,
701
+ "<|20.98|>": 51413,
702
+ "<|21.00|>": 51414,
703
+ "<|21.02|>": 51415,
704
+ "<|21.04|>": 51416,
705
+ "<|21.06|>": 51417,
706
+ "<|21.08|>": 51418,
707
+ "<|21.10|>": 51419,
708
+ "<|21.12|>": 51420,
709
+ "<|21.14|>": 51421,
710
+ "<|21.16|>": 51422,
711
+ "<|21.18|>": 51423,
712
+ "<|21.20|>": 51424,
713
+ "<|21.22|>": 51425,
714
+ "<|21.24|>": 51426,
715
+ "<|21.26|>": 51427,
716
+ "<|21.28|>": 51428,
717
+ "<|21.30|>": 51429,
718
+ "<|21.32|>": 51430,
719
+ "<|21.34|>": 51431,
720
+ "<|21.36|>": 51432,
721
+ "<|21.38|>": 51433,
722
+ "<|21.40|>": 51434,
723
+ "<|21.42|>": 51435,
724
+ "<|21.44|>": 51436,
725
+ "<|21.46|>": 51437,
726
+ "<|21.48|>": 51438,
727
+ "<|21.50|>": 51439,
728
+ "<|21.52|>": 51440,
729
+ "<|21.54|>": 51441,
730
+ "<|21.56|>": 51442,
731
+ "<|21.58|>": 51443,
732
+ "<|21.60|>": 51444,
733
+ "<|21.62|>": 51445,
734
+ "<|21.64|>": 51446,
735
+ "<|21.66|>": 51447,
736
+ "<|21.68|>": 51448,
737
+ "<|21.70|>": 51449,
738
+ "<|21.72|>": 51450,
739
+ "<|21.74|>": 51451,
740
+ "<|21.76|>": 51452,
741
+ "<|21.78|>": 51453,
742
+ "<|21.80|>": 51454,
743
+ "<|21.82|>": 51455,
744
+ "<|21.84|>": 51456,
745
+ "<|21.86|>": 51457,
746
+ "<|21.88|>": 51458,
747
+ "<|21.90|>": 51459,
748
+ "<|21.92|>": 51460,
749
+ "<|21.94|>": 51461,
750
+ "<|21.96|>": 51462,
751
+ "<|21.98|>": 51463,
752
+ "<|22.00|>": 51464,
753
+ "<|22.02|>": 51465,
754
+ "<|22.04|>": 51466,
755
+ "<|22.06|>": 51467,
756
+ "<|22.08|>": 51468,
757
+ "<|22.10|>": 51469,
758
+ "<|22.12|>": 51470,
759
+ "<|22.14|>": 51471,
760
+ "<|22.16|>": 51472,
761
+ "<|22.18|>": 51473,
762
+ "<|22.20|>": 51474,
763
+ "<|22.22|>": 51475,
764
+ "<|22.24|>": 51476,
765
+ "<|22.26|>": 51477,
766
+ "<|22.28|>": 51478,
767
+ "<|22.30|>": 51479,
768
+ "<|22.32|>": 51480,
769
+ "<|22.34|>": 51481,
770
+ "<|22.36|>": 51482,
771
+ "<|22.38|>": 51483,
772
+ "<|22.40|>": 51484,
773
+ "<|22.42|>": 51485,
774
+ "<|22.44|>": 51486,
775
+ "<|22.46|>": 51487,
776
+ "<|22.48|>": 51488,
777
+ "<|22.50|>": 51489,
778
+ "<|22.52|>": 51490,
779
+ "<|22.54|>": 51491,
780
+ "<|22.56|>": 51492,
781
+ "<|22.58|>": 51493,
782
+ "<|22.60|>": 51494,
783
+ "<|22.62|>": 51495,
784
+ "<|22.64|>": 51496,
785
+ "<|22.66|>": 51497,
786
+ "<|22.68|>": 51498,
787
+ "<|22.70|>": 51499,
788
+ "<|22.72|>": 51500,
789
+ "<|22.74|>": 51501,
790
+ "<|22.76|>": 51502,
791
+ "<|22.78|>": 51503,
792
+ "<|22.80|>": 51504,
793
+ "<|22.82|>": 51505,
794
+ "<|22.84|>": 51506,
795
+ "<|22.86|>": 51507,
796
+ "<|22.88|>": 51508,
797
+ "<|22.90|>": 51509,
798
+ "<|22.92|>": 51510,
799
+ "<|22.94|>": 51511,
800
+ "<|22.96|>": 51512,
801
+ "<|22.98|>": 51513,
802
+ "<|23.00|>": 51514,
803
+ "<|23.02|>": 51515,
804
+ "<|23.04|>": 51516,
805
+ "<|23.06|>": 51517,
806
+ "<|23.08|>": 51518,
807
+ "<|23.10|>": 51519,
808
+ "<|23.12|>": 51520,
809
+ "<|23.14|>": 51521,
810
+ "<|23.16|>": 51522,
811
+ "<|23.18|>": 51523,
812
+ "<|23.20|>": 51524,
813
+ "<|23.22|>": 51525,
814
+ "<|23.24|>": 51526,
815
+ "<|23.26|>": 51527,
816
+ "<|23.28|>": 51528,
817
+ "<|23.30|>": 51529,
818
+ "<|23.32|>": 51530,
819
+ "<|23.34|>": 51531,
820
+ "<|23.36|>": 51532,
821
+ "<|23.38|>": 51533,
822
+ "<|23.40|>": 51534,
823
+ "<|23.42|>": 51535,
824
+ "<|23.44|>": 51536,
825
+ "<|23.46|>": 51537,
826
+ "<|23.48|>": 51538,
827
+ "<|23.50|>": 51539,
828
+ "<|23.52|>": 51540,
829
+ "<|23.54|>": 51541,
830
+ "<|23.56|>": 51542,
831
+ "<|23.58|>": 51543,
832
+ "<|23.60|>": 51544,
833
+ "<|23.62|>": 51545,
834
+ "<|23.64|>": 51546,
835
+ "<|23.66|>": 51547,
836
+ "<|23.68|>": 51548,
837
+ "<|23.70|>": 51549,
838
+ "<|23.72|>": 51550,
839
+ "<|23.74|>": 51551,
840
+ "<|23.76|>": 51552,
841
+ "<|23.78|>": 51553,
842
+ "<|23.80|>": 51554,
843
+ "<|23.82|>": 51555,
844
+ "<|23.84|>": 51556,
845
+ "<|23.86|>": 51557,
846
+ "<|23.88|>": 51558,
847
+ "<|23.90|>": 51559,
848
+ "<|23.92|>": 51560,
849
+ "<|23.94|>": 51561,
850
+ "<|23.96|>": 51562,
851
+ "<|23.98|>": 51563,
852
+ "<|24.00|>": 51564,
853
+ "<|24.02|>": 51565,
854
+ "<|24.04|>": 51566,
855
+ "<|24.06|>": 51567,
856
+ "<|24.08|>": 51568,
857
+ "<|24.10|>": 51569,
858
+ "<|24.12|>": 51570,
859
+ "<|24.14|>": 51571,
860
+ "<|24.16|>": 51572,
861
+ "<|24.18|>": 51573,
862
+ "<|24.20|>": 51574,
863
+ "<|24.22|>": 51575,
864
+ "<|24.24|>": 51576,
865
+ "<|24.26|>": 51577,
866
+ "<|24.28|>": 51578,
867
+ "<|24.30|>": 51579,
868
+ "<|24.32|>": 51580,
869
+ "<|24.34|>": 51581,
870
+ "<|24.36|>": 51582,
871
+ "<|24.38|>": 51583,
872
+ "<|24.40|>": 51584,
873
+ "<|24.42|>": 51585,
874
+ "<|24.44|>": 51586,
875
+ "<|24.46|>": 51587,
876
+ "<|24.48|>": 51588,
877
+ "<|24.50|>": 51589,
878
+ "<|24.52|>": 51590,
879
+ "<|24.54|>": 51591,
880
+ "<|24.56|>": 51592,
881
+ "<|24.58|>": 51593,
882
+ "<|24.60|>": 51594,
883
+ "<|24.62|>": 51595,
884
+ "<|24.64|>": 51596,
885
+ "<|24.66|>": 51597,
886
+ "<|24.68|>": 51598,
887
+ "<|24.70|>": 51599,
888
+ "<|24.72|>": 51600,
889
+ "<|24.74|>": 51601,
890
+ "<|24.76|>": 51602,
891
+ "<|24.78|>": 51603,
892
+ "<|24.80|>": 51604,
893
+ "<|24.82|>": 51605,
894
+ "<|24.84|>": 51606,
895
+ "<|24.86|>": 51607,
896
+ "<|24.88|>": 51608,
897
+ "<|24.90|>": 51609,
898
+ "<|24.92|>": 51610,
899
+ "<|24.94|>": 51611,
900
+ "<|24.96|>": 51612,
901
+ "<|24.98|>": 51613,
902
+ "<|25.00|>": 51614,
903
+ "<|25.02|>": 51615,
904
+ "<|25.04|>": 51616,
905
+ "<|25.06|>": 51617,
906
+ "<|25.08|>": 51618,
907
+ "<|25.10|>": 51619,
908
+ "<|25.12|>": 51620,
909
+ "<|25.14|>": 51621,
910
+ "<|25.16|>": 51622,
911
+ "<|25.18|>": 51623,
912
+ "<|25.20|>": 51624,
913
+ "<|25.22|>": 51625,
914
+ "<|25.24|>": 51626,
915
+ "<|25.26|>": 51627,
916
+ "<|25.28|>": 51628,
917
+ "<|25.30|>": 51629,
918
+ "<|25.32|>": 51630,
919
+ "<|25.34|>": 51631,
920
+ "<|25.36|>": 51632,
921
+ "<|25.38|>": 51633,
922
+ "<|25.40|>": 51634,
923
+ "<|25.42|>": 51635,
924
+ "<|25.44|>": 51636,
925
+ "<|25.46|>": 51637,
926
+ "<|25.48|>": 51638,
927
+ "<|25.50|>": 51639,
928
+ "<|25.52|>": 51640,
929
+ "<|25.54|>": 51641,
930
+ "<|25.56|>": 51642,
931
+ "<|25.58|>": 51643,
932
+ "<|25.60|>": 51644,
933
+ "<|25.62|>": 51645,
934
+ "<|25.64|>": 51646,
935
+ "<|25.66|>": 51647,
936
+ "<|25.68|>": 51648,
937
+ "<|25.70|>": 51649,
938
+ "<|25.72|>": 51650,
939
+ "<|25.74|>": 51651,
940
+ "<|25.76|>": 51652,
941
+ "<|25.78|>": 51653,
942
+ "<|25.80|>": 51654,
943
+ "<|25.82|>": 51655,
944
+ "<|25.84|>": 51656,
945
+ "<|25.86|>": 51657,
946
+ "<|25.88|>": 51658,
947
+ "<|25.90|>": 51659,
948
+ "<|25.92|>": 51660,
949
+ "<|25.94|>": 51661,
950
+ "<|25.96|>": 51662,
951
+ "<|25.98|>": 51663,
952
+ "<|26.00|>": 51664,
953
+ "<|26.02|>": 51665,
954
+ "<|26.04|>": 51666,
955
+ "<|26.06|>": 51667,
956
+ "<|26.08|>": 51668,
957
+ "<|26.10|>": 51669,
958
+ "<|26.12|>": 51670,
959
+ "<|26.14|>": 51671,
960
+ "<|26.16|>": 51672,
961
+ "<|26.18|>": 51673,
962
+ "<|26.20|>": 51674,
963
+ "<|26.22|>": 51675,
964
+ "<|26.24|>": 51676,
965
+ "<|26.26|>": 51677,
966
+ "<|26.28|>": 51678,
967
+ "<|26.30|>": 51679,
968
+ "<|26.32|>": 51680,
969
+ "<|26.34|>": 51681,
970
+ "<|26.36|>": 51682,
971
+ "<|26.38|>": 51683,
972
+ "<|26.40|>": 51684,
973
+ "<|26.42|>": 51685,
974
+ "<|26.44|>": 51686,
975
+ "<|26.46|>": 51687,
976
+ "<|26.48|>": 51688,
977
+ "<|26.50|>": 51689,
978
+ "<|26.52|>": 51690,
979
+ "<|26.54|>": 51691,
980
+ "<|26.56|>": 51692,
981
+ "<|26.58|>": 51693,
982
+ "<|26.60|>": 51694,
983
+ "<|26.62|>": 51695,
984
+ "<|26.64|>": 51696,
985
+ "<|26.66|>": 51697,
986
+ "<|26.68|>": 51698,
987
+ "<|26.70|>": 51699,
988
+ "<|26.72|>": 51700,
989
+ "<|26.74|>": 51701,
990
+ "<|26.76|>": 51702,
991
+ "<|26.78|>": 51703,
992
+ "<|26.80|>": 51704,
993
+ "<|26.82|>": 51705,
994
+ "<|26.84|>": 51706,
995
+ "<|26.86|>": 51707,
996
+ "<|26.88|>": 51708,
997
+ "<|26.90|>": 51709,
998
+ "<|26.92|>": 51710,
999
+ "<|26.94|>": 51711,
1000
+ "<|26.96|>": 51712,
1001
+ "<|26.98|>": 51713,
1002
+ "<|27.00|>": 51714,
1003
+ "<|27.02|>": 51715,
1004
+ "<|27.04|>": 51716,
1005
+ "<|27.06|>": 51717,
1006
+ "<|27.08|>": 51718,
1007
+ "<|27.10|>": 51719,
1008
+ "<|27.12|>": 51720,
1009
+ "<|27.14|>": 51721,
1010
+ "<|27.16|>": 51722,
1011
+ "<|27.18|>": 51723,
1012
+ "<|27.20|>": 51724,
1013
+ "<|27.22|>": 51725,
1014
+ "<|27.24|>": 51726,
1015
+ "<|27.26|>": 51727,
1016
+ "<|27.28|>": 51728,
1017
+ "<|27.30|>": 51729,
1018
+ "<|27.32|>": 51730,
1019
+ "<|27.34|>": 51731,
1020
+ "<|27.36|>": 51732,
1021
+ "<|27.38|>": 51733,
1022
+ "<|27.40|>": 51734,
1023
+ "<|27.42|>": 51735,
1024
+ "<|27.44|>": 51736,
1025
+ "<|27.46|>": 51737,
1026
+ "<|27.48|>": 51738,
1027
+ "<|27.50|>": 51739,
1028
+ "<|27.52|>": 51740,
1029
+ "<|27.54|>": 51741,
1030
+ "<|27.56|>": 51742,
1031
+ "<|27.58|>": 51743,
1032
+ "<|27.60|>": 51744,
1033
+ "<|27.62|>": 51745,
1034
+ "<|27.64|>": 51746,
1035
+ "<|27.66|>": 51747,
1036
+ "<|27.68|>": 51748,
1037
+ "<|27.70|>": 51749,
1038
+ "<|27.72|>": 51750,
1039
+ "<|27.74|>": 51751,
1040
+ "<|27.76|>": 51752,
1041
+ "<|27.78|>": 51753,
1042
+ "<|27.80|>": 51754,
1043
+ "<|27.82|>": 51755,
1044
+ "<|27.84|>": 51756,
1045
+ "<|27.86|>": 51757,
1046
+ "<|27.88|>": 51758,
1047
+ "<|27.90|>": 51759,
1048
+ "<|27.92|>": 51760,
1049
+ "<|27.94|>": 51761,
1050
+ "<|27.96|>": 51762,
1051
+ "<|27.98|>": 51763,
1052
+ "<|28.00|>": 51764,
1053
+ "<|28.02|>": 51765,
1054
+ "<|28.04|>": 51766,
1055
+ "<|28.06|>": 51767,
1056
+ "<|28.08|>": 51768,
1057
+ "<|28.10|>": 51769,
1058
+ "<|28.12|>": 51770,
1059
+ "<|28.14|>": 51771,
1060
+ "<|28.16|>": 51772,
1061
+ "<|28.18|>": 51773,
1062
+ "<|28.20|>": 51774,
1063
+ "<|28.22|>": 51775,
1064
+ "<|28.24|>": 51776,
1065
+ "<|28.26|>": 51777,
1066
+ "<|28.28|>": 51778,
1067
+ "<|28.30|>": 51779,
1068
+ "<|28.32|>": 51780,
1069
+ "<|28.34|>": 51781,
1070
+ "<|28.36|>": 51782,
1071
+ "<|28.38|>": 51783,
1072
+ "<|28.40|>": 51784,
1073
+ "<|28.42|>": 51785,
1074
+ "<|28.44|>": 51786,
1075
+ "<|28.46|>": 51787,
1076
+ "<|28.48|>": 51788,
1077
+ "<|28.50|>": 51789,
1078
+ "<|28.52|>": 51790,
1079
+ "<|28.54|>": 51791,
1080
+ "<|28.56|>": 51792,
1081
+ "<|28.58|>": 51793,
1082
+ "<|28.60|>": 51794,
1083
+ "<|28.62|>": 51795,
1084
+ "<|28.64|>": 51796,
1085
+ "<|28.66|>": 51797,
1086
+ "<|28.68|>": 51798,
1087
+ "<|28.70|>": 51799,
1088
+ "<|28.72|>": 51800,
1089
+ "<|28.74|>": 51801,
1090
+ "<|28.76|>": 51802,
1091
+ "<|28.78|>": 51803,
1092
+ "<|28.80|>": 51804,
1093
+ "<|28.82|>": 51805,
1094
+ "<|28.84|>": 51806,
1095
+ "<|28.86|>": 51807,
1096
+ "<|28.88|>": 51808,
1097
+ "<|28.90|>": 51809,
1098
+ "<|28.92|>": 51810,
1099
+ "<|28.94|>": 51811,
1100
+ "<|28.96|>": 51812,
1101
+ "<|28.98|>": 51813,
1102
+ "<|29.00|>": 51814,
1103
+ "<|29.02|>": 51815,
1104
+ "<|29.04|>": 51816,
1105
+ "<|29.06|>": 51817,
1106
+ "<|29.08|>": 51818,
1107
+ "<|29.10|>": 51819,
1108
+ "<|29.12|>": 51820,
1109
+ "<|29.14|>": 51821,
1110
+ "<|29.16|>": 51822,
1111
+ "<|29.18|>": 51823,
1112
+ "<|29.20|>": 51824,
1113
+ "<|29.22|>": 51825,
1114
+ "<|29.24|>": 51826,
1115
+ "<|29.26|>": 51827,
1116
+ "<|29.28|>": 51828,
1117
+ "<|29.30|>": 51829,
1118
+ "<|29.32|>": 51830,
1119
+ "<|29.34|>": 51831,
1120
+ "<|29.36|>": 51832,
1121
+ "<|29.38|>": 51833,
1122
+ "<|29.40|>": 51834,
1123
+ "<|29.42|>": 51835,
1124
+ "<|29.44|>": 51836,
1125
+ "<|29.46|>": 51837,
1126
+ "<|29.48|>": 51838,
1127
+ "<|29.50|>": 51839,
1128
+ "<|29.52|>": 51840,
1129
+ "<|29.54|>": 51841,
1130
+ "<|29.56|>": 51842,
1131
+ "<|29.58|>": 51843,
1132
+ "<|29.60|>": 51844,
1133
+ "<|29.62|>": 51845,
1134
+ "<|29.64|>": 51846,
1135
+ "<|29.66|>": 51847,
1136
+ "<|29.68|>": 51848,
1137
+ "<|29.70|>": 51849,
1138
+ "<|29.72|>": 51850,
1139
+ "<|29.74|>": 51851,
1140
+ "<|29.76|>": 51852,
1141
+ "<|29.78|>": 51853,
1142
+ "<|29.80|>": 51854,
1143
+ "<|29.82|>": 51855,
1144
+ "<|29.84|>": 51856,
1145
+ "<|29.86|>": 51857,
1146
+ "<|29.88|>": 51858,
1147
+ "<|29.90|>": 51859,
1148
+ "<|29.92|>": 51860,
1149
+ "<|29.94|>": 51861,
1150
+ "<|29.96|>": 51862,
1151
+ "<|29.98|>": 51863,
1152
+ "<|3.00|>": 50514,
1153
+ "<|3.02|>": 50515,
1154
+ "<|3.04|>": 50516,
1155
+ "<|3.06|>": 50517,
1156
+ "<|3.08|>": 50518,
1157
+ "<|3.10|>": 50519,
1158
+ "<|3.12|>": 50520,
1159
+ "<|3.14|>": 50521,
1160
+ "<|3.16|>": 50522,
1161
+ "<|3.18|>": 50523,
1162
+ "<|3.20|>": 50524,
1163
+ "<|3.22|>": 50525,
1164
+ "<|3.24|>": 50526,
1165
+ "<|3.26|>": 50527,
1166
+ "<|3.28|>": 50528,
1167
+ "<|3.30|>": 50529,
1168
+ "<|3.32|>": 50530,
1169
+ "<|3.34|>": 50531,
1170
+ "<|3.36|>": 50532,
1171
+ "<|3.38|>": 50533,
1172
+ "<|3.40|>": 50534,
1173
+ "<|3.42|>": 50535,
1174
+ "<|3.44|>": 50536,
1175
+ "<|3.46|>": 50537,
1176
+ "<|3.48|>": 50538,
1177
+ "<|3.50|>": 50539,
1178
+ "<|3.52|>": 50540,
1179
+ "<|3.54|>": 50541,
1180
+ "<|3.56|>": 50542,
1181
+ "<|3.58|>": 50543,
1182
+ "<|3.60|>": 50544,
1183
+ "<|3.62|>": 50545,
1184
+ "<|3.64|>": 50546,
1185
+ "<|3.66|>": 50547,
1186
+ "<|3.68|>": 50548,
1187
+ "<|3.70|>": 50549,
1188
+ "<|3.72|>": 50550,
1189
+ "<|3.74|>": 50551,
1190
+ "<|3.76|>": 50552,
1191
+ "<|3.78|>": 50553,
1192
+ "<|3.80|>": 50554,
1193
+ "<|3.82|>": 50555,
1194
+ "<|3.84|>": 50556,
1195
+ "<|3.86|>": 50557,
1196
+ "<|3.88|>": 50558,
1197
+ "<|3.90|>": 50559,
1198
+ "<|3.92|>": 50560,
1199
+ "<|3.94|>": 50561,
1200
+ "<|3.96|>": 50562,
1201
+ "<|3.98|>": 50563,
1202
+ "<|30.00|>": 51864,
1203
+ "<|4.00|>": 50564,
1204
+ "<|4.02|>": 50565,
1205
+ "<|4.04|>": 50566,
1206
+ "<|4.06|>": 50567,
1207
+ "<|4.08|>": 50568,
1208
+ "<|4.10|>": 50569,
1209
+ "<|4.12|>": 50570,
1210
+ "<|4.14|>": 50571,
1211
+ "<|4.16|>": 50572,
1212
+ "<|4.18|>": 50573,
1213
+ "<|4.20|>": 50574,
1214
+ "<|4.22|>": 50575,
1215
+ "<|4.24|>": 50576,
1216
+ "<|4.26|>": 50577,
1217
+ "<|4.28|>": 50578,
1218
+ "<|4.30|>": 50579,
1219
+ "<|4.32|>": 50580,
1220
+ "<|4.34|>": 50581,
1221
+ "<|4.36|>": 50582,
1222
+ "<|4.38|>": 50583,
1223
+ "<|4.40|>": 50584,
1224
+ "<|4.42|>": 50585,
1225
+ "<|4.44|>": 50586,
1226
+ "<|4.46|>": 50587,
1227
+ "<|4.48|>": 50588,
1228
+ "<|4.50|>": 50589,
1229
+ "<|4.52|>": 50590,
1230
+ "<|4.54|>": 50591,
1231
+ "<|4.56|>": 50592,
1232
+ "<|4.58|>": 50593,
1233
+ "<|4.60|>": 50594,
1234
+ "<|4.62|>": 50595,
1235
+ "<|4.64|>": 50596,
1236
+ "<|4.66|>": 50597,
1237
+ "<|4.68|>": 50598,
1238
+ "<|4.70|>": 50599,
1239
+ "<|4.72|>": 50600,
1240
+ "<|4.74|>": 50601,
1241
+ "<|4.76|>": 50602,
1242
+ "<|4.78|>": 50603,
1243
+ "<|4.80|>": 50604,
1244
+ "<|4.82|>": 50605,
1245
+ "<|4.84|>": 50606,
1246
+ "<|4.86|>": 50607,
1247
+ "<|4.88|>": 50608,
1248
+ "<|4.90|>": 50609,
1249
+ "<|4.92|>": 50610,
1250
+ "<|4.94|>": 50611,
1251
+ "<|4.96|>": 50612,
1252
+ "<|4.98|>": 50613,
1253
+ "<|5.00|>": 50614,
1254
+ "<|5.02|>": 50615,
1255
+ "<|5.04|>": 50616,
1256
+ "<|5.06|>": 50617,
1257
+ "<|5.08|>": 50618,
1258
+ "<|5.10|>": 50619,
1259
+ "<|5.12|>": 50620,
1260
+ "<|5.14|>": 50621,
1261
+ "<|5.16|>": 50622,
1262
+ "<|5.18|>": 50623,
1263
+ "<|5.20|>": 50624,
1264
+ "<|5.22|>": 50625,
1265
+ "<|5.24|>": 50626,
1266
+ "<|5.26|>": 50627,
1267
+ "<|5.28|>": 50628,
1268
+ "<|5.30|>": 50629,
1269
+ "<|5.32|>": 50630,
1270
+ "<|5.34|>": 50631,
1271
+ "<|5.36|>": 50632,
1272
+ "<|5.38|>": 50633,
1273
+ "<|5.40|>": 50634,
1274
+ "<|5.42|>": 50635,
1275
+ "<|5.44|>": 50636,
1276
+ "<|5.46|>": 50637,
1277
+ "<|5.48|>": 50638,
1278
+ "<|5.50|>": 50639,
1279
+ "<|5.52|>": 50640,
1280
+ "<|5.54|>": 50641,
1281
+ "<|5.56|>": 50642,
1282
+ "<|5.58|>": 50643,
1283
+ "<|5.60|>": 50644,
1284
+ "<|5.62|>": 50645,
1285
+ "<|5.64|>": 50646,
1286
+ "<|5.66|>": 50647,
1287
+ "<|5.68|>": 50648,
1288
+ "<|5.70|>": 50649,
1289
+ "<|5.72|>": 50650,
1290
+ "<|5.74|>": 50651,
1291
+ "<|5.76|>": 50652,
1292
+ "<|5.78|>": 50653,
1293
+ "<|5.80|>": 50654,
1294
+ "<|5.82|>": 50655,
1295
+ "<|5.84|>": 50656,
1296
+ "<|5.86|>": 50657,
1297
+ "<|5.88|>": 50658,
1298
+ "<|5.90|>": 50659,
1299
+ "<|5.92|>": 50660,
1300
+ "<|5.94|>": 50661,
1301
+ "<|5.96|>": 50662,
1302
+ "<|5.98|>": 50663,
1303
+ "<|6.00|>": 50664,
1304
+ "<|6.02|>": 50665,
1305
+ "<|6.04|>": 50666,
1306
+ "<|6.06|>": 50667,
1307
+ "<|6.08|>": 50668,
1308
+ "<|6.10|>": 50669,
1309
+ "<|6.12|>": 50670,
1310
+ "<|6.14|>": 50671,
1311
+ "<|6.16|>": 50672,
1312
+ "<|6.18|>": 50673,
1313
+ "<|6.20|>": 50674,
1314
+ "<|6.22|>": 50675,
1315
+ "<|6.24|>": 50676,
1316
+ "<|6.26|>": 50677,
1317
+ "<|6.28|>": 50678,
1318
+ "<|6.30|>": 50679,
1319
+ "<|6.32|>": 50680,
1320
+ "<|6.34|>": 50681,
1321
+ "<|6.36|>": 50682,
1322
+ "<|6.38|>": 50683,
1323
+ "<|6.40|>": 50684,
1324
+ "<|6.42|>": 50685,
1325
+ "<|6.44|>": 50686,
1326
+ "<|6.46|>": 50687,
1327
+ "<|6.48|>": 50688,
1328
+ "<|6.50|>": 50689,
1329
+ "<|6.52|>": 50690,
1330
+ "<|6.54|>": 50691,
1331
+ "<|6.56|>": 50692,
1332
+ "<|6.58|>": 50693,
1333
+ "<|6.60|>": 50694,
1334
+ "<|6.62|>": 50695,
1335
+ "<|6.64|>": 50696,
1336
+ "<|6.66|>": 50697,
1337
+ "<|6.68|>": 50698,
1338
+ "<|6.70|>": 50699,
1339
+ "<|6.72|>": 50700,
1340
+ "<|6.74|>": 50701,
1341
+ "<|6.76|>": 50702,
1342
+ "<|6.78|>": 50703,
1343
+ "<|6.80|>": 50704,
1344
+ "<|6.82|>": 50705,
1345
+ "<|6.84|>": 50706,
1346
+ "<|6.86|>": 50707,
1347
+ "<|6.88|>": 50708,
1348
+ "<|6.90|>": 50709,
1349
+ "<|6.92|>": 50710,
1350
+ "<|6.94|>": 50711,
1351
+ "<|6.96|>": 50712,
1352
+ "<|6.98|>": 50713,
1353
+ "<|7.00|>": 50714,
1354
+ "<|7.02|>": 50715,
1355
+ "<|7.04|>": 50716,
1356
+ "<|7.06|>": 50717,
1357
+ "<|7.08|>": 50718,
1358
+ "<|7.10|>": 50719,
1359
+ "<|7.12|>": 50720,
1360
+ "<|7.14|>": 50721,
1361
+ "<|7.16|>": 50722,
1362
+ "<|7.18|>": 50723,
1363
+ "<|7.20|>": 50724,
1364
+ "<|7.22|>": 50725,
1365
+ "<|7.24|>": 50726,
1366
+ "<|7.26|>": 50727,
1367
+ "<|7.28|>": 50728,
1368
+ "<|7.30|>": 50729,
1369
+ "<|7.32|>": 50730,
1370
+ "<|7.34|>": 50731,
1371
+ "<|7.36|>": 50732,
1372
+ "<|7.38|>": 50733,
1373
+ "<|7.40|>": 50734,
1374
+ "<|7.42|>": 50735,
1375
+ "<|7.44|>": 50736,
1376
+ "<|7.46|>": 50737,
1377
+ "<|7.48|>": 50738,
1378
+ "<|7.50|>": 50739,
1379
+ "<|7.52|>": 50740,
1380
+ "<|7.54|>": 50741,
1381
+ "<|7.56|>": 50742,
1382
+ "<|7.58|>": 50743,
1383
+ "<|7.60|>": 50744,
1384
+ "<|7.62|>": 50745,
1385
+ "<|7.64|>": 50746,
1386
+ "<|7.66|>": 50747,
1387
+ "<|7.68|>": 50748,
1388
+ "<|7.70|>": 50749,
1389
+ "<|7.72|>": 50750,
1390
+ "<|7.74|>": 50751,
1391
+ "<|7.76|>": 50752,
1392
+ "<|7.78|>": 50753,
1393
+ "<|7.80|>": 50754,
1394
+ "<|7.82|>": 50755,
1395
+ "<|7.84|>": 50756,
1396
+ "<|7.86|>": 50757,
1397
+ "<|7.88|>": 50758,
1398
+ "<|7.90|>": 50759,
1399
+ "<|7.92|>": 50760,
1400
+ "<|7.94|>": 50761,
1401
+ "<|7.96|>": 50762,
1402
+ "<|7.98|>": 50763,
1403
+ "<|8.00|>": 50764,
1404
+ "<|8.02|>": 50765,
1405
+ "<|8.04|>": 50766,
1406
+ "<|8.06|>": 50767,
1407
+ "<|8.08|>": 50768,
1408
+ "<|8.10|>": 50769,
1409
+ "<|8.12|>": 50770,
1410
+ "<|8.14|>": 50771,
1411
+ "<|8.16|>": 50772,
1412
+ "<|8.18|>": 50773,
1413
+ "<|8.20|>": 50774,
1414
+ "<|8.22|>": 50775,
1415
+ "<|8.24|>": 50776,
1416
+ "<|8.26|>": 50777,
1417
+ "<|8.28|>": 50778,
1418
+ "<|8.30|>": 50779,
1419
+ "<|8.32|>": 50780,
1420
+ "<|8.34|>": 50781,
1421
+ "<|8.36|>": 50782,
1422
+ "<|8.38|>": 50783,
1423
+ "<|8.40|>": 50784,
1424
+ "<|8.42|>": 50785,
1425
+ "<|8.44|>": 50786,
1426
+ "<|8.46|>": 50787,
1427
+ "<|8.48|>": 50788,
1428
+ "<|8.50|>": 50789,
1429
+ "<|8.52|>": 50790,
1430
+ "<|8.54|>": 50791,
1431
+ "<|8.56|>": 50792,
1432
+ "<|8.58|>": 50793,
1433
+ "<|8.60|>": 50794,
1434
+ "<|8.62|>": 50795,
1435
+ "<|8.64|>": 50796,
1436
+ "<|8.66|>": 50797,
1437
+ "<|8.68|>": 50798,
1438
+ "<|8.70|>": 50799,
1439
+ "<|8.72|>": 50800,
1440
+ "<|8.74|>": 50801,
1441
+ "<|8.76|>": 50802,
1442
+ "<|8.78|>": 50803,
1443
+ "<|8.80|>": 50804,
1444
+ "<|8.82|>": 50805,
1445
+ "<|8.84|>": 50806,
1446
+ "<|8.86|>": 50807,
1447
+ "<|8.88|>": 50808,
1448
+ "<|8.90|>": 50809,
1449
+ "<|8.92|>": 50810,
1450
+ "<|8.94|>": 50811,
1451
+ "<|8.96|>": 50812,
1452
+ "<|8.98|>": 50813,
1453
+ "<|9.00|>": 50814,
1454
+ "<|9.02|>": 50815,
1455
+ "<|9.04|>": 50816,
1456
+ "<|9.06|>": 50817,
1457
+ "<|9.08|>": 50818,
1458
+ "<|9.10|>": 50819,
1459
+ "<|9.12|>": 50820,
1460
+ "<|9.14|>": 50821,
1461
+ "<|9.16|>": 50822,
1462
+ "<|9.18|>": 50823,
1463
+ "<|9.20|>": 50824,
1464
+ "<|9.22|>": 50825,
1465
+ "<|9.24|>": 50826,
1466
+ "<|9.26|>": 50827,
1467
+ "<|9.28|>": 50828,
1468
+ "<|9.30|>": 50829,
1469
+ "<|9.32|>": 50830,
1470
+ "<|9.34|>": 50831,
1471
+ "<|9.36|>": 50832,
1472
+ "<|9.38|>": 50833,
1473
+ "<|9.40|>": 50834,
1474
+ "<|9.42|>": 50835,
1475
+ "<|9.44|>": 50836,
1476
+ "<|9.46|>": 50837,
1477
+ "<|9.48|>": 50838,
1478
+ "<|9.50|>": 50839,
1479
+ "<|9.52|>": 50840,
1480
+ "<|9.54|>": 50841,
1481
+ "<|9.56|>": 50842,
1482
+ "<|9.58|>": 50843,
1483
+ "<|9.60|>": 50844,
1484
+ "<|9.62|>": 50845,
1485
+ "<|9.64|>": 50846,
1486
+ "<|9.66|>": 50847,
1487
+ "<|9.68|>": 50848,
1488
+ "<|9.70|>": 50849,
1489
+ "<|9.72|>": 50850,
1490
+ "<|9.74|>": 50851,
1491
+ "<|9.76|>": 50852,
1492
+ "<|9.78|>": 50853,
1493
+ "<|9.80|>": 50854,
1494
+ "<|9.82|>": 50855,
1495
+ "<|9.84|>": 50856,
1496
+ "<|9.86|>": 50857,
1497
+ "<|9.88|>": 50858,
1498
+ "<|9.90|>": 50859,
1499
+ "<|9.92|>": 50860,
1500
+ "<|9.94|>": 50861,
1501
+ "<|9.96|>": 50862,
1502
+ "<|9.98|>": 50863,
1503
+ "<|af|>": 50327,
1504
+ "<|am|>": 50334,
1505
+ "<|ar|>": 50272,
1506
+ "<|as|>": 50350,
1507
+ "<|az|>": 50304,
1508
+ "<|ba|>": 50355,
1509
+ "<|be|>": 50330,
1510
+ "<|bg|>": 50292,
1511
+ "<|bn|>": 50302,
1512
+ "<|bo|>": 50347,
1513
+ "<|br|>": 50309,
1514
+ "<|bs|>": 50315,
1515
+ "<|ca|>": 50270,
1516
+ "<|cs|>": 50283,
1517
+ "<|cy|>": 50297,
1518
+ "<|da|>": 50285,
1519
+ "<|de|>": 50261,
1520
+ "<|el|>": 50281,
1521
+ "<|en|>": 50259,
1522
+ "<|es|>": 50262,
1523
+ "<|et|>": 50307,
1524
+ "<|eu|>": 50310,
1525
+ "<|fa|>": 50300,
1526
+ "<|fi|>": 50277,
1527
+ "<|fo|>": 50338,
1528
+ "<|fr|>": 50265,
1529
+ "<|gl|>": 50319,
1530
+ "<|gu|>": 50333,
1531
+ "<|haw|>": 50352,
1532
+ "<|ha|>": 50354,
1533
+ "<|he|>": 50279,
1534
+ "<|hi|>": 50276,
1535
+ "<|hr|>": 50291,
1536
+ "<|ht|>": 50339,
1537
+ "<|hu|>": 50286,
1538
+ "<|hy|>": 50312,
1539
+ "<|id|>": 50275,
1540
+ "<|is|>": 50311,
1541
+ "<|it|>": 50274,
1542
+ "<|ja|>": 50266,
1543
+ "<|jw|>": 50356,
1544
+ "<|ka|>": 50329,
1545
+ "<|kk|>": 50316,
1546
+ "<|km|>": 50323,
1547
+ "<|kn|>": 50306,
1548
+ "<|ko|>": 50264,
1549
+ "<|la|>": 50294,
1550
+ "<|lb|>": 50345,
1551
+ "<|ln|>": 50353,
1552
+ "<|lo|>": 50336,
1553
+ "<|lt|>": 50293,
1554
+ "<|lv|>": 50301,
1555
+ "<|mg|>": 50349,
1556
+ "<|mi|>": 50295,
1557
+ "<|mk|>": 50308,
1558
+ "<|ml|>": 50296,
1559
+ "<|mn|>": 50314,
1560
+ "<|mr|>": 50320,
1561
+ "<|ms|>": 50282,
1562
+ "<|mt|>": 50343,
1563
+ "<|my|>": 50346,
1564
+ "<|ne|>": 50313,
1565
+ "<|nl|>": 50271,
1566
+ "<|nn|>": 50342,
1567
+ "<|nocaptions|>": 50362,
1568
+ "<|notimestamps|>": 50363,
1569
+ "<|no|>": 50288,
1570
+ "<|oc|>": 50328,
1571
+ "<|pa|>": 50321,
1572
+ "<|pl|>": 50269,
1573
+ "<|ps|>": 50340,
1574
+ "<|pt|>": 50267,
1575
+ "<|ro|>": 50284,
1576
+ "<|ru|>": 50263,
1577
+ "<|sa|>": 50344,
1578
+ "<|sd|>": 50332,
1579
+ "<|si|>": 50322,
1580
+ "<|sk|>": 50298,
1581
+ "<|sl|>": 50305,
1582
+ "<|sn|>": 50324,
1583
+ "<|so|>": 50326,
1584
+ "<|sq|>": 50317,
1585
+ "<|sr|>": 50303,
1586
+ "<|startoflm|>": 50360,
1587
+ "<|startofprev|>": 50361,
1588
+ "<|startoftranscript|>": 50258,
1589
+ "<|su|>": 50357,
1590
+ "<|sv|>": 50273,
1591
+ "<|sw|>": 50318,
1592
+ "<|ta|>": 50287,
1593
+ "<|te|>": 50299,
1594
+ "<|tg|>": 50331,
1595
+ "<|th|>": 50289,
1596
+ "<|tk|>": 50341,
1597
+ "<|tl|>": 50348,
1598
+ "<|transcribe|>": 50359,
1599
+ "<|translate|>": 50358,
1600
+ "<|tr|>": 50268,
1601
+ "<|tt|>": 50351,
1602
+ "<|uk|>": 50280,
1603
+ "<|ur|>": 50290,
1604
+ "<|uz|>": 50337,
1605
+ "<|vi|>": 50278,
1606
+ "<|yi|>": 50335,
1607
+ "<|yo|>": 50325,
1608
+ "<|zh|>": 50260
1609
+ }
config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai/whisper-base",
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "apply_spec_augment": false,
6
+ "architectures": [
7
+ "WhisperMLAForConditionalGeneration"
8
+ ],
9
+ "attention_dropout": 0.0,
10
+ "begin_suppress_tokens": null,
11
+ "bos_token_id": 50257,
12
+ "classifier_proj_size": 256,
13
+ "d_model": 512,
14
+ "decoder_attention_heads": 8,
15
+ "decoder_ffn_dim": 2048,
16
+ "decoder_layerdrop": 0.0,
17
+ "decoder_layers": 6,
18
+ "decoder_start_token_id": 50258,
19
+ "dropout": 0.0,
20
+ "encoder_attention_heads": 8,
21
+ "encoder_ffn_dim": 2048,
22
+ "encoder_layerdrop": 0.0,
23
+ "encoder_layers": 6,
24
+ "eos_token_id": 50257,
25
+ "init_std": 0.02,
26
+ "is_encoder_decoder": true,
27
+ "mask_feature_length": 10,
28
+ "mask_feature_min_masks": 0,
29
+ "mask_feature_prob": 0.0,
30
+ "mask_time_length": 10,
31
+ "mask_time_min_masks": 2,
32
+ "mask_time_prob": 0.05,
33
+ "max_length": null,
34
+ "max_source_positions": 1500,
35
+ "max_target_positions": 448,
36
+ "median_filter_width": 7,
37
+ "model_type": "whisper_mla",
38
+ "num_hidden_layers": 6,
39
+ "num_mel_bins": 80,
40
+ "pad_token_id": 50257,
41
+ "scale_embedding": false,
42
+ "torch_dtype": "float32",
43
+ "transformers_version": "4.46.3",
44
+ "use_cache": true,
45
+ "use_weighted_layer_sum": false,
46
+ "vocab_size": 51865,
47
+ "auto_map": {
48
+ "AutoConfig": "configuration_whisper_mla.WhisperMLAConfig",
49
+ "AutoModel": "modeling_whisper_mla.WhisperMLAForConditionalGeneration",
50
+ "AutoModelForSpeechSeq2Seq": "modeling_whisper_mla.WhisperMLAForConditionalGeneration"
51
+ },
52
+ "mla_scheme": "partial_preservation",
53
+ "mla_scope": "decoder_self",
54
+ "mla_selection": "uniform",
55
+ "mla_low_rank": 16,
56
+ "mla_rope_dim": 32
57
+ }
configuration_whisper_mla.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """WhisperMLA configuration — WhisperConfig + the MLA conversion axes.
2
+
3
+ Shipped inside released model repos (trust_remote_code); loaded by AutoConfig via auto_map.
4
+ """
5
+ from transformers import WhisperConfig
6
+
7
+
8
+ class WhisperMLAConfig(WhisperConfig):
9
+ model_type = "whisper_mla"
10
+
11
+ def __init__(self, mla_scheme: str = "partial_preservation", mla_scope: str = "decoder_self",
12
+ mla_selection: str = "uniform", mla_low_rank: int = 16, mla_rope_dim: int = 32,
13
+ **kwargs):
14
+ self.mla_scheme = mla_scheme
15
+ self.mla_scope = mla_scope
16
+ self.mla_selection = mla_selection
17
+ self.mla_low_rank = mla_low_rank
18
+ self.mla_rope_dim = mla_rope_dim
19
+ super().__init__(**kwargs)
generation_config.json ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alignment_heads": [
3
+ [
4
+ 3,
5
+ 1
6
+ ],
7
+ [
8
+ 4,
9
+ 2
10
+ ],
11
+ [
12
+ 4,
13
+ 3
14
+ ],
15
+ [
16
+ 4,
17
+ 7
18
+ ],
19
+ [
20
+ 5,
21
+ 1
22
+ ],
23
+ [
24
+ 5,
25
+ 2
26
+ ],
27
+ [
28
+ 5,
29
+ 4
30
+ ],
31
+ [
32
+ 5,
33
+ 6
34
+ ]
35
+ ],
36
+ "begin_suppress_tokens": [
37
+ 220,
38
+ 50257
39
+ ],
40
+ "bos_token_id": 50257,
41
+ "decoder_start_token_id": 50258,
42
+ "eos_token_id": 50257,
43
+ "is_multilingual": true,
44
+ "lang_to_id": {
45
+ "<|af|>": 50327,
46
+ "<|am|>": 50334,
47
+ "<|ar|>": 50272,
48
+ "<|as|>": 50350,
49
+ "<|az|>": 50304,
50
+ "<|ba|>": 50355,
51
+ "<|be|>": 50330,
52
+ "<|bg|>": 50292,
53
+ "<|bn|>": 50302,
54
+ "<|bo|>": 50347,
55
+ "<|br|>": 50309,
56
+ "<|bs|>": 50315,
57
+ "<|ca|>": 50270,
58
+ "<|cs|>": 50283,
59
+ "<|cy|>": 50297,
60
+ "<|da|>": 50285,
61
+ "<|de|>": 50261,
62
+ "<|el|>": 50281,
63
+ "<|en|>": 50259,
64
+ "<|es|>": 50262,
65
+ "<|et|>": 50307,
66
+ "<|eu|>": 50310,
67
+ "<|fa|>": 50300,
68
+ "<|fi|>": 50277,
69
+ "<|fo|>": 50338,
70
+ "<|fr|>": 50265,
71
+ "<|gl|>": 50319,
72
+ "<|gu|>": 50333,
73
+ "<|haw|>": 50352,
74
+ "<|ha|>": 50354,
75
+ "<|he|>": 50279,
76
+ "<|hi|>": 50276,
77
+ "<|hr|>": 50291,
78
+ "<|ht|>": 50339,
79
+ "<|hu|>": 50286,
80
+ "<|hy|>": 50312,
81
+ "<|id|>": 50275,
82
+ "<|is|>": 50311,
83
+ "<|it|>": 50274,
84
+ "<|ja|>": 50266,
85
+ "<|jw|>": 50356,
86
+ "<|ka|>": 50329,
87
+ "<|kk|>": 50316,
88
+ "<|km|>": 50323,
89
+ "<|kn|>": 50306,
90
+ "<|ko|>": 50264,
91
+ "<|la|>": 50294,
92
+ "<|lb|>": 50345,
93
+ "<|ln|>": 50353,
94
+ "<|lo|>": 50336,
95
+ "<|lt|>": 50293,
96
+ "<|lv|>": 50301,
97
+ "<|mg|>": 50349,
98
+ "<|mi|>": 50295,
99
+ "<|mk|>": 50308,
100
+ "<|ml|>": 50296,
101
+ "<|mn|>": 50314,
102
+ "<|mr|>": 50320,
103
+ "<|ms|>": 50282,
104
+ "<|mt|>": 50343,
105
+ "<|my|>": 50346,
106
+ "<|ne|>": 50313,
107
+ "<|nl|>": 50271,
108
+ "<|nn|>": 50342,
109
+ "<|no|>": 50288,
110
+ "<|oc|>": 50328,
111
+ "<|pa|>": 50321,
112
+ "<|pl|>": 50269,
113
+ "<|ps|>": 50340,
114
+ "<|pt|>": 50267,
115
+ "<|ro|>": 50284,
116
+ "<|ru|>": 50263,
117
+ "<|sa|>": 50344,
118
+ "<|sd|>": 50332,
119
+ "<|si|>": 50322,
120
+ "<|sk|>": 50298,
121
+ "<|sl|>": 50305,
122
+ "<|sn|>": 50324,
123
+ "<|so|>": 50326,
124
+ "<|sq|>": 50317,
125
+ "<|sr|>": 50303,
126
+ "<|su|>": 50357,
127
+ "<|sv|>": 50273,
128
+ "<|sw|>": 50318,
129
+ "<|ta|>": 50287,
130
+ "<|te|>": 50299,
131
+ "<|tg|>": 50331,
132
+ "<|th|>": 50289,
133
+ "<|tk|>": 50341,
134
+ "<|tl|>": 50348,
135
+ "<|tr|>": 50268,
136
+ "<|tt|>": 50351,
137
+ "<|uk|>": 50280,
138
+ "<|ur|>": 50290,
139
+ "<|uz|>": 50337,
140
+ "<|vi|>": 50278,
141
+ "<|yi|>": 50335,
142
+ "<|yo|>": 50325,
143
+ "<|zh|>": 50260
144
+ },
145
+ "max_initial_timestamp_index": 50,
146
+ "max_length": 448,
147
+ "no_timestamps_token_id": 50363,
148
+ "pad_token_id": 50257,
149
+ "prev_sot_token_id": 50361,
150
+ "return_timestamps": false,
151
+ "suppress_tokens": [
152
+ 1,
153
+ 2,
154
+ 7,
155
+ 8,
156
+ 9,
157
+ 10,
158
+ 14,
159
+ 25,
160
+ 26,
161
+ 27,
162
+ 28,
163
+ 29,
164
+ 31,
165
+ 58,
166
+ 59,
167
+ 60,
168
+ 61,
169
+ 62,
170
+ 63,
171
+ 90,
172
+ 91,
173
+ 92,
174
+ 93,
175
+ 359,
176
+ 503,
177
+ 522,
178
+ 542,
179
+ 873,
180
+ 893,
181
+ 902,
182
+ 918,
183
+ 922,
184
+ 931,
185
+ 1350,
186
+ 1853,
187
+ 1982,
188
+ 2460,
189
+ 2627,
190
+ 3246,
191
+ 3253,
192
+ 3268,
193
+ 3536,
194
+ 3846,
195
+ 3961,
196
+ 4183,
197
+ 4667,
198
+ 6585,
199
+ 6647,
200
+ 7273,
201
+ 9061,
202
+ 9383,
203
+ 10428,
204
+ 10929,
205
+ 11938,
206
+ 12033,
207
+ 12331,
208
+ 12562,
209
+ 13793,
210
+ 14157,
211
+ 14635,
212
+ 15265,
213
+ 15618,
214
+ 16553,
215
+ 16604,
216
+ 18362,
217
+ 18956,
218
+ 20075,
219
+ 21675,
220
+ 22520,
221
+ 26130,
222
+ 26161,
223
+ 26435,
224
+ 28279,
225
+ 29464,
226
+ 31650,
227
+ 32302,
228
+ 32470,
229
+ 36865,
230
+ 42863,
231
+ 47425,
232
+ 49870,
233
+ 50254,
234
+ 50258,
235
+ 50358,
236
+ 50359,
237
+ 50360,
238
+ 50361,
239
+ 50362
240
+ ],
241
+ "task_to_id": {
242
+ "transcribe": 50359,
243
+ "translate": 50358
244
+ },
245
+ "transformers_version": "4.46.3"
246
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be0ef903f6dda7ea68173e3d374fc1611f15abaee46af105f7663a3b025dbf21
3
+ size 142468680
modeling_whisper.py ADDED
@@ -0,0 +1,1777 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This script is based on https://github.com/huggingface/transformers/blob/v4.29.1/src/transformers/models/whisper/modeling_whisper.py
2
+
3
+ """ PyTorch Whisper model."""
4
+
5
+ import math
6
+ import random
7
+ from typing import Optional, Tuple, Union
8
+
9
+ import numpy as np
10
+ import torch
11
+ import torch.utils.checkpoint
12
+ from torch import nn
13
+ from torch.nn import CrossEntropyLoss
14
+
15
+ from transformers.activations import ACT2FN
16
+ from transformers.generation.logits_process import WhisperTimeStampLogitsProcessor
17
+ from transformers.modeling_outputs import (
18
+ BaseModelOutput,
19
+ BaseModelOutputWithPastAndCrossAttentions,
20
+ Seq2SeqLMOutput,
21
+ Seq2SeqModelOutput,
22
+ SequenceClassifierOutput,
23
+ )
24
+ from transformers.modeling_utils import PreTrainedModel
25
+ from transformers.utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
26
+ from transformers.models.whisper.configuration_whisper import WhisperConfig
27
+ from transformers.models.whisper.tokenization_whisper import TASK_IDS, TO_LANGUAGE_CODE
28
+
29
+
30
+ logger = logging.get_logger(__name__)
31
+
32
+ _CONFIG_FOR_DOC = "WhisperConfig"
33
+ _CHECKPOINT_FOR_DOC = "openai/whisper-tiny"
34
+
35
+
36
+ WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = [
37
+ "openai/whisper-base",
38
+ # See all Whisper models at https://huggingface.co/models?filter=whisper
39
+ ]
40
+
41
+
42
+ # Copied from transformers.models.bart.modeling_bart.shift_tokens_right
43
+ def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int):
44
+ """
45
+ Shift input ids one token to the right.
46
+ """
47
+ shifted_input_ids = input_ids.new_zeros(input_ids.shape)
48
+ shifted_input_ids[:, 1:] = input_ids[:, :-1].clone()
49
+ shifted_input_ids[:, 0] = decoder_start_token_id
50
+
51
+ if pad_token_id is None:
52
+ raise ValueError("self.model.config.pad_token_id has to be defined.")
53
+ # replace possible -100 values in labels by `pad_token_id`
54
+ shifted_input_ids.masked_fill_(shifted_input_ids == -100, pad_token_id)
55
+
56
+ return shifted_input_ids
57
+
58
+
59
+ # Copied from transformers.models.bart.modeling_bart._make_causal_mask
60
+ def _make_causal_mask(
61
+ input_ids_shape: torch.Size, dtype: torch.dtype, device: torch.device, past_key_values_length: int = 0
62
+ ):
63
+ """
64
+ Make causal mask used for bi-directional self-attention.
65
+ """
66
+ bsz, tgt_len = input_ids_shape
67
+ mask = torch.full((tgt_len, tgt_len), torch.tensor(torch.finfo(dtype).min, device=device), device=device)
68
+ mask_cond = torch.arange(mask.size(-1), device=device)
69
+ mask.masked_fill_(mask_cond < (mask_cond + 1).view(mask.size(-1), 1), 0)
70
+ mask = mask.to(dtype)
71
+
72
+ if past_key_values_length > 0:
73
+ mask = torch.cat([torch.zeros(tgt_len, past_key_values_length, dtype=dtype, device=device), mask], dim=-1)
74
+ return mask[None, None, :, :].expand(bsz, 1, tgt_len, tgt_len + past_key_values_length)
75
+
76
+
77
+ # Copied from transformers.models.bart.modeling_bart._expand_mask
78
+ def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
79
+ """
80
+ Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
81
+ """
82
+ bsz, src_len = mask.size()
83
+ tgt_len = tgt_len if tgt_len is not None else src_len
84
+
85
+ expanded_mask = mask[:, None, None, :].expand(bsz, 1, tgt_len, src_len).to(dtype)
86
+
87
+ inverted_mask = 1.0 - expanded_mask
88
+
89
+ return inverted_mask.masked_fill(inverted_mask.to(torch.bool), torch.finfo(dtype).min)
90
+
91
+
92
+ # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices
93
+ def _compute_mask_indices(
94
+ shape: Tuple[int, int],
95
+ mask_prob: float,
96
+ mask_length: int,
97
+ attention_mask: Optional[torch.LongTensor] = None,
98
+ min_masks: int = 0,
99
+ ) -> np.ndarray:
100
+ """
101
+ Computes random mask spans for a given shape. Used to implement [SpecAugment: A Simple Data Augmentation Method for
102
+ ASR](https://arxiv.org/abs/1904.08779). Note that this method is not optimized to run on TPU and should be run on
103
+ CPU as part of the preprocessing during training.
104
+
105
+ Args:
106
+ shape: The shape for which to compute masks. This should be of a tuple of size 2 where
107
+ the first element is the batch size and the second element is the length of the axis to span.
108
+ mask_prob: The percentage of the whole axis (between 0 and 1) which will be masked. The number of
109
+ independently generated mask spans of length `mask_length` is computed by
110
+ `mask_prob*shape[1]/mask_length`. Note that due to overlaps, `mask_prob` is an upper bound and the
111
+ actual percentage will be smaller.
112
+ mask_length: size of the mask
113
+ min_masks: minimum number of masked spans
114
+ attention_mask: A (right-padded) attention mask which independently shortens the feature axis of
115
+ each batch dimension.
116
+ """
117
+ batch_size, sequence_length = shape
118
+
119
+ if mask_length < 1:
120
+ raise ValueError("`mask_length` has to be bigger than 0.")
121
+
122
+ if mask_length > sequence_length:
123
+ raise ValueError(
124
+ f"`mask_length` has to be smaller than `sequence_length`, but got `mask_length`: {mask_length}"
125
+ f" and `sequence_length`: {sequence_length}`"
126
+ )
127
+
128
+ # epsilon is used for probabilistic rounding
129
+ epsilon = np.random.rand(1).item()
130
+
131
+ def compute_num_masked_span(input_length):
132
+ """Given input length, compute how many spans should be masked"""
133
+ num_masked_span = int(mask_prob * input_length / mask_length + epsilon)
134
+ num_masked_span = max(num_masked_span, min_masks)
135
+
136
+ # make sure num masked span <= sequence_length
137
+ if num_masked_span * mask_length > sequence_length:
138
+ num_masked_span = sequence_length // mask_length
139
+
140
+ # make sure num_masked span is also <= input_length - (mask_length - 1)
141
+ if input_length - (mask_length - 1) < num_masked_span:
142
+ num_masked_span = max(input_length - (mask_length - 1), 0)
143
+
144
+ return num_masked_span
145
+
146
+ # compute number of masked spans in batch
147
+ input_lengths = (
148
+ attention_mask.sum(-1).detach().tolist()
149
+ if attention_mask is not None
150
+ else [sequence_length for _ in range(batch_size)]
151
+ )
152
+
153
+ # SpecAugment mask to fill
154
+ spec_aug_mask = np.zeros((batch_size, sequence_length), dtype=bool)
155
+ spec_aug_mask_idxs = []
156
+
157
+ max_num_masked_span = compute_num_masked_span(sequence_length)
158
+
159
+ if max_num_masked_span == 0:
160
+ return spec_aug_mask
161
+
162
+ for input_length in input_lengths:
163
+ # compute num of masked spans for this input
164
+ num_masked_span = compute_num_masked_span(input_length)
165
+
166
+ # get random indices to mask
167
+ spec_aug_mask_idx = np.random.choice(
168
+ np.arange(input_length - (mask_length - 1)), num_masked_span, replace=False
169
+ )
170
+
171
+ # pick first sampled index that will serve as a dummy index to pad vector
172
+ # to ensure same dimension for all batches due to probabilistic rounding
173
+ # Picking first sample just pads those vectors twice.
174
+ if len(spec_aug_mask_idx) == 0:
175
+ # this case can only happen if `input_length` is strictly smaller then
176
+ # `sequence_length` in which case the last token has to be a padding
177
+ # token which we can use as a dummy mask id
178
+ dummy_mask_idx = sequence_length - 1
179
+ else:
180
+ dummy_mask_idx = spec_aug_mask_idx[0]
181
+
182
+ spec_aug_mask_idx = np.concatenate(
183
+ [spec_aug_mask_idx, np.ones(max_num_masked_span - num_masked_span, dtype=np.int32) * dummy_mask_idx]
184
+ )
185
+ spec_aug_mask_idxs.append(spec_aug_mask_idx)
186
+
187
+ spec_aug_mask_idxs = np.array(spec_aug_mask_idxs)
188
+
189
+ # expand masked indices to masked spans
190
+ spec_aug_mask_idxs = np.broadcast_to(
191
+ spec_aug_mask_idxs[:, :, None], (batch_size, max_num_masked_span, mask_length)
192
+ )
193
+ spec_aug_mask_idxs = spec_aug_mask_idxs.reshape(batch_size, max_num_masked_span * mask_length)
194
+
195
+ # add offset to the starting indexes so that indexes now create a span
196
+ offsets = np.arange(mask_length)[None, None, :]
197
+ offsets = np.broadcast_to(offsets, (batch_size, max_num_masked_span, mask_length)).reshape(
198
+ batch_size, max_num_masked_span * mask_length
199
+ )
200
+ spec_aug_mask_idxs = spec_aug_mask_idxs + offsets
201
+
202
+ # ensure that we cannot have indices larger than sequence_length
203
+ if spec_aug_mask_idxs.max() > sequence_length - 1:
204
+ spec_aug_mask_idxs[spec_aug_mask_idxs > sequence_length - 1] = sequence_length - 1
205
+
206
+ # scatter indices to mask
207
+ np.put_along_axis(spec_aug_mask, spec_aug_mask_idxs, 1, -1)
208
+
209
+ return spec_aug_mask
210
+
211
+
212
+ class WhisperPositionalEmbedding(nn.Embedding):
213
+ def __init__(self, num_positions: int, embedding_dim: int, padding_idx: Optional[int] = None):
214
+ super().__init__(num_positions, embedding_dim)
215
+
216
+ def forward(self, input_ids, past_key_values_length=0):
217
+ return self.weight[past_key_values_length : past_key_values_length + input_ids.shape[1]]
218
+
219
+
220
+ class WhisperAttention(nn.Module):
221
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
222
+
223
+ def __init__(
224
+ self,
225
+ embed_dim: int,
226
+ num_heads: int,
227
+ dropout: float = 0.0,
228
+ is_decoder: bool = False,
229
+ bias: bool = True,
230
+ ):
231
+ super().__init__()
232
+ self.embed_dim = embed_dim
233
+ self.num_heads = num_heads
234
+ self.dropout = dropout
235
+ self.head_dim = embed_dim // num_heads
236
+
237
+ if (self.head_dim * num_heads) != self.embed_dim:
238
+ raise ValueError(
239
+ f"embed_dim must be divisible by num_heads (got `embed_dim`: {self.embed_dim}"
240
+ f" and `num_heads`: {num_heads})."
241
+ )
242
+ self.scaling = self.head_dim**-0.5
243
+ self.is_decoder = is_decoder
244
+
245
+ self.k_proj = nn.Linear(embed_dim, embed_dim, bias=False)
246
+ self.v_proj = nn.Linear(embed_dim, embed_dim, bias=bias)
247
+ self.q_proj = nn.Linear(embed_dim, embed_dim, bias=bias)
248
+ self.out_proj = nn.Linear(embed_dim, embed_dim, bias=bias)
249
+
250
+ # Copied from transformers.models.bart.modeling_bart.BartAttention._shape with BART->whisper
251
+ def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
252
+ return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).transpose(1, 2).contiguous()
253
+
254
+ # Copied from transformers.models.bart.modeling_bart.BartAttention.forward with BART->whisper
255
+ def forward(
256
+ self,
257
+ hidden_states: torch.Tensor,
258
+ key_value_states: Optional[torch.Tensor] = None,
259
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
260
+ attention_mask: Optional[torch.Tensor] = None,
261
+ layer_head_mask: Optional[torch.Tensor] = None,
262
+ output_attentions: bool = False,
263
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
264
+ """Input shape: Batch x Time x Channel"""
265
+
266
+ # if key_value_states are provided this layer is used as a cross-attention layer
267
+ # for the decoder
268
+ is_cross_attention = key_value_states is not None
269
+
270
+ bsz, tgt_len, _ = hidden_states.size()
271
+
272
+ # get query proj
273
+ query_states = self.q_proj(hidden_states) * self.scaling
274
+ # get key, value proj
275
+ # `past_key_value[0].shape[2] == key_value_states.shape[1]`
276
+ # is checking that the `sequence_length` of the `past_key_value` is the same as
277
+ # the provided `key_value_states` to support prefix tuning
278
+ if (
279
+ is_cross_attention
280
+ and past_key_value is not None
281
+ and past_key_value[0].shape[2] == key_value_states.shape[1]
282
+ ):
283
+ # reuse k,v, cross_attentions
284
+ key_states = past_key_value[0]
285
+ value_states = past_key_value[1]
286
+ elif is_cross_attention:
287
+ # cross_attentions
288
+ key_states = self._shape(self.k_proj(key_value_states), -1, bsz)
289
+ value_states = self._shape(self.v_proj(key_value_states), -1, bsz)
290
+ elif past_key_value is not None:
291
+ # reuse k, v, self_attention
292
+ key_states = self._shape(self.k_proj(hidden_states), -1, bsz)
293
+ value_states = self._shape(self.v_proj(hidden_states), -1, bsz)
294
+ key_states = torch.cat([past_key_value[0], key_states], dim=2)
295
+ value_states = torch.cat([past_key_value[1], value_states], dim=2)
296
+ else:
297
+ # self_attention
298
+ key_states = self._shape(self.k_proj(hidden_states), -1, bsz)
299
+ value_states = self._shape(self.v_proj(hidden_states), -1, bsz)
300
+
301
+ if self.is_decoder:
302
+ # if cross_attention save Tuple(torch.Tensor, torch.Tensor) of all cross attention key/value_states.
303
+ # Further calls to cross_attention layer can then reuse all cross-attention
304
+ # key/value_states (first "if" case)
305
+ # if uni-directional self-attention (decoder) save Tuple(torch.Tensor, torch.Tensor) of
306
+ # all previous decoder key/value_states. Further calls to uni-directional self-attention
307
+ # can concat previous decoder key/value_states to current projected key/value_states (third "elif" case)
308
+ # if encoder bi-directional self-attention `past_key_value` is always `None`
309
+ past_key_value = (key_states, value_states)
310
+
311
+ proj_shape = (bsz * self.num_heads, -1, self.head_dim)
312
+ query_states = self._shape(query_states, tgt_len, bsz).view(*proj_shape)
313
+ key_states = key_states.reshape(*proj_shape)
314
+ value_states = value_states.reshape(*proj_shape)
315
+
316
+ src_len = key_states.size(1)
317
+ attn_weights = torch.bmm(query_states, key_states.transpose(1, 2))
318
+
319
+ if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
320
+ raise ValueError(
321
+ f"Attention weights should be of size {(bsz * self.num_heads, tgt_len, src_len)}, but is"
322
+ f" {attn_weights.size()}"
323
+ )
324
+
325
+ if attention_mask is not None:
326
+ if attention_mask.size() != (bsz, 1, tgt_len, src_len):
327
+ raise ValueError(
328
+ f"Attention mask should be of size {(bsz, 1, tgt_len, src_len)}, but is {attention_mask.size()}"
329
+ )
330
+ attn_weights = attn_weights.view(bsz, self.num_heads, tgt_len, src_len) + attention_mask
331
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
332
+
333
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1)
334
+
335
+ if layer_head_mask is not None:
336
+ if layer_head_mask.size() != (self.num_heads,):
337
+ raise ValueError(
338
+ f"Head mask for a single layer should be of size {(self.num_heads,)}, but is"
339
+ f" {layer_head_mask.size()}"
340
+ )
341
+ attn_weights = layer_head_mask.view(1, -1, 1, 1) * attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
342
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
343
+
344
+ if output_attentions:
345
+ # this operation is a bit awkward, but it's required to
346
+ # make sure that attn_weights keeps its gradient.
347
+ # In order to do so, attn_weights have to be reshaped
348
+ # twice and have to be reused in the following
349
+ attn_weights_reshaped = attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
350
+ attn_weights = attn_weights_reshaped.view(bsz * self.num_heads, tgt_len, src_len)
351
+ else:
352
+ attn_weights_reshaped = None
353
+
354
+ attn_probs = nn.functional.dropout(attn_weights, p=self.dropout, training=self.training)
355
+
356
+ attn_output = torch.bmm(attn_probs, value_states)
357
+
358
+ if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
359
+ raise ValueError(
360
+ f"`attn_output` should be of size {(bsz * self.num_heads, tgt_len, self.head_dim)}, but is"
361
+ f" {attn_output.size()}"
362
+ )
363
+
364
+ attn_output = attn_output.view(bsz, self.num_heads, tgt_len, self.head_dim)
365
+ attn_output = attn_output.transpose(1, 2)
366
+
367
+ # Use the `embed_dim` from the config (stored in the class) rather than `hidden_state` because `attn_output` can be
368
+ # partitioned across GPUs when using tensor-parallelism.
369
+ attn_output = attn_output.reshape(bsz, tgt_len, self.embed_dim)
370
+
371
+ attn_output = self.out_proj(attn_output)
372
+
373
+ return attn_output, attn_weights_reshaped, past_key_value
374
+
375
+
376
+ # Copied from transformers.models.mbart.modeling_mbart.MBartEncoderLayer with MBart->Whisper
377
+ class WhisperEncoderLayer(nn.Module):
378
+ def __init__(self, config: WhisperConfig):
379
+ super().__init__()
380
+ self.embed_dim = config.d_model
381
+ self.self_attn = WhisperAttention(
382
+ embed_dim=self.embed_dim,
383
+ num_heads=config.encoder_attention_heads,
384
+ dropout=config.attention_dropout,
385
+ )
386
+ self.self_attn_layer_norm = nn.LayerNorm(self.embed_dim)
387
+ self.dropout = config.dropout
388
+ self.activation_fn = ACT2FN[config.activation_function]
389
+ self.activation_dropout = config.activation_dropout
390
+ self.fc1 = nn.Linear(self.embed_dim, config.encoder_ffn_dim)
391
+ self.fc2 = nn.Linear(config.encoder_ffn_dim, self.embed_dim)
392
+ self.final_layer_norm = nn.LayerNorm(self.embed_dim)
393
+
394
+ def forward(
395
+ self,
396
+ hidden_states: torch.Tensor,
397
+ attention_mask: torch.Tensor,
398
+ layer_head_mask: torch.Tensor,
399
+ output_attentions: bool = False,
400
+ ) -> torch.Tensor:
401
+ """
402
+ Args:
403
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
404
+ attention_mask (`torch.FloatTensor`): attention mask of size
405
+ `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
406
+ layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
407
+ `(encoder_attention_heads,)`.
408
+ output_attentions (`bool`, *optional*):
409
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
410
+ returned tensors for more detail.
411
+ """
412
+ residual = hidden_states
413
+ hidden_states = self.self_attn_layer_norm(hidden_states)
414
+ hidden_states, attn_weights, _ = self.self_attn(
415
+ hidden_states=hidden_states,
416
+ attention_mask=attention_mask,
417
+ layer_head_mask=layer_head_mask,
418
+ output_attentions=output_attentions,
419
+ )
420
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
421
+ hidden_states = residual + hidden_states
422
+
423
+ residual = hidden_states
424
+ hidden_states = self.final_layer_norm(hidden_states)
425
+ hidden_states = self.activation_fn(self.fc1(hidden_states))
426
+ hidden_states = nn.functional.dropout(hidden_states, p=self.activation_dropout, training=self.training)
427
+ hidden_states = self.fc2(hidden_states)
428
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
429
+ hidden_states = residual + hidden_states
430
+
431
+ if hidden_states.dtype == torch.float16 and (
432
+ torch.isinf(hidden_states).any() or torch.isnan(hidden_states).any()
433
+ ):
434
+ clamp_value = torch.finfo(hidden_states.dtype).max - 1000
435
+ hidden_states = torch.clamp(hidden_states, min=-clamp_value, max=clamp_value)
436
+
437
+ outputs = (hidden_states,)
438
+
439
+ if output_attentions:
440
+ outputs += (attn_weights,)
441
+
442
+ return outputs
443
+
444
+
445
+ # Copied from transformers.models.mbart.modeling_mbart.MBartDecoderLayer with MBart->Whisper
446
+ class WhisperDecoderLayer(nn.Module):
447
+ def __init__(self, config: WhisperConfig):
448
+ super().__init__()
449
+ self.embed_dim = config.d_model
450
+
451
+ self.self_attn = WhisperAttention(
452
+ embed_dim=self.embed_dim,
453
+ num_heads=config.decoder_attention_heads,
454
+ dropout=config.attention_dropout,
455
+ is_decoder=True,
456
+ )
457
+ self.dropout = config.dropout
458
+ self.activation_fn = ACT2FN[config.activation_function]
459
+ self.activation_dropout = config.activation_dropout
460
+
461
+ self.self_attn_layer_norm = nn.LayerNorm(self.embed_dim)
462
+ self.encoder_attn = WhisperAttention(
463
+ self.embed_dim,
464
+ config.decoder_attention_heads,
465
+ dropout=config.attention_dropout,
466
+ is_decoder=True,
467
+ )
468
+ self.encoder_attn_layer_norm = nn.LayerNorm(self.embed_dim)
469
+ self.fc1 = nn.Linear(self.embed_dim, config.decoder_ffn_dim)
470
+ self.fc2 = nn.Linear(config.decoder_ffn_dim, self.embed_dim)
471
+ self.final_layer_norm = nn.LayerNorm(self.embed_dim)
472
+
473
+ def forward(
474
+ self,
475
+ hidden_states: torch.Tensor,
476
+ attention_mask: Optional[torch.Tensor] = None,
477
+ encoder_hidden_states: Optional[torch.Tensor] = None,
478
+ encoder_attention_mask: Optional[torch.Tensor] = None,
479
+ layer_head_mask: Optional[torch.Tensor] = None,
480
+ cross_attn_layer_head_mask: Optional[torch.Tensor] = None,
481
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
482
+ output_attentions: Optional[bool] = False,
483
+ use_cache: Optional[bool] = True,
484
+ ) -> torch.Tensor:
485
+ """
486
+ Args:
487
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
488
+ attention_mask (`torch.FloatTensor`): attention mask of size
489
+ `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
490
+ encoder_hidden_states (`torch.FloatTensor`):
491
+ cross attention input to the layer of shape `(batch, seq_len, embed_dim)`
492
+ encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
493
+ `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
494
+ layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
495
+ `(encoder_attention_heads,)`.
496
+ cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
497
+ size `(decoder_attention_heads,)`.
498
+ past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
499
+ output_attentions (`bool`, *optional*):
500
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
501
+ returned tensors for more detail.
502
+ """
503
+ residual = hidden_states
504
+ hidden_states = self.self_attn_layer_norm(hidden_states)
505
+
506
+ # Self Attention
507
+ # decoder uni-directional self-attention cached key/values tuple is at positions 1,2
508
+ self_attn_past_key_value = past_key_value[:2] if past_key_value is not None else None
509
+ # add present self-attn cache to positions 1,2 of present_key_value tuple
510
+ hidden_states, self_attn_weights, present_key_value = self.self_attn(
511
+ hidden_states=hidden_states,
512
+ past_key_value=self_attn_past_key_value,
513
+ attention_mask=attention_mask,
514
+ layer_head_mask=layer_head_mask,
515
+ output_attentions=output_attentions,
516
+ )
517
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
518
+ hidden_states = residual + hidden_states
519
+
520
+ # Cross-Attention Block
521
+ cross_attn_present_key_value = None
522
+ cross_attn_weights = None
523
+ if encoder_hidden_states is not None:
524
+ residual = hidden_states
525
+ hidden_states = self.encoder_attn_layer_norm(hidden_states)
526
+
527
+ # cross_attn cached key/values tuple is at positions 3,4 of present_key_value tuple
528
+ cross_attn_past_key_value = past_key_value[-2:] if past_key_value is not None else None
529
+ hidden_states, cross_attn_weights, cross_attn_present_key_value = self.encoder_attn(
530
+ hidden_states=hidden_states,
531
+ key_value_states=encoder_hidden_states,
532
+ attention_mask=encoder_attention_mask,
533
+ layer_head_mask=cross_attn_layer_head_mask,
534
+ past_key_value=cross_attn_past_key_value,
535
+ output_attentions=output_attentions,
536
+ )
537
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
538
+ hidden_states = residual + hidden_states
539
+
540
+ # add cross-attn to positions 3,4 of present_key_value tuple
541
+ #present_key_value = present_key_value + cross_attn_present_key_value
542
+
543
+ # Fully Connected
544
+ residual = hidden_states
545
+ hidden_states = self.final_layer_norm(hidden_states)
546
+ hidden_states = self.activation_fn(self.fc1(hidden_states))
547
+ hidden_states = nn.functional.dropout(hidden_states, p=self.activation_dropout, training=self.training)
548
+ hidden_states = self.fc2(hidden_states)
549
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
550
+ hidden_states = residual + hidden_states
551
+
552
+ outputs = (hidden_states,)
553
+
554
+ if output_attentions:
555
+ outputs += (self_attn_weights, cross_attn_weights)
556
+
557
+ if use_cache:
558
+ outputs += (present_key_value,)
559
+
560
+ return outputs
561
+
562
+
563
+ class WhisperPreTrainedModel(PreTrainedModel):
564
+ config_class = WhisperConfig
565
+ base_model_prefix = "model"
566
+ main_input_name = "input_features"
567
+ supports_gradient_checkpointing = True
568
+ _no_split_modules = ["WhisperEncoderLayer", "WhisperDecoderLayer"]
569
+
570
+ def _init_weights(self, module):
571
+ std = self.config.init_std
572
+ if isinstance(module, (nn.Linear, nn.Conv1d)):
573
+ module.weight.data.normal_(mean=0.0, std=std)
574
+ if module.bias is not None:
575
+ module.bias.data.zero_()
576
+ elif isinstance(module, nn.Embedding):
577
+ module.weight.data.normal_(mean=0.0, std=std)
578
+ if module.padding_idx is not None:
579
+ module.weight.data[module.padding_idx].zero_()
580
+
581
+ def _set_gradient_checkpointing(self, module, value=False):
582
+ if isinstance(module, (WhisperDecoder, WhisperEncoder)):
583
+ module.gradient_checkpointing = value
584
+
585
+ def _get_feat_extract_output_lengths(self, input_lengths: torch.LongTensor):
586
+ """
587
+ Computes the output length of the convolutional layers
588
+ """
589
+ input_lengths = (input_lengths - 1) // 2 + 1
590
+
591
+ return input_lengths
592
+
593
+
594
+ WHISPER_START_DOCSTRING = r"""
595
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
596
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
597
+ etc.)
598
+
599
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
600
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
601
+ and behavior.
602
+
603
+ Parameters:
604
+ config ([`WhisperConfig`]):
605
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
606
+ load the weights associated with the model, only the configuration. Check out the
607
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
608
+ """
609
+
610
+ WHISPER_INPUTS_DOCSTRING = r"""
611
+ Args:
612
+ input_features (`torch.FloatTensor` of shape `(batch_size, feature_size, sequence_length)`):
613
+ Float values mel features extracted from the raw speech waveform. Raw speech waveform can be obtained by
614
+ loading a `.flac` or `.wav` audio file into an array of type `List[float]` or a `numpy.ndarray`, *e.g.* via
615
+ the soundfile library (`pip install soundfile`). To prepare the array into `input_features`, the
616
+ [`AutoFeatureExtractor`] should be used for extracting the mel features, padding and conversion into a
617
+ tensor of type `torch.FloatTensor`. See [`~WhisperFeatureExtractor.__call__`]
618
+ attention_mask (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
619
+ Mask to avoid performing *SpecAugment* data augmentation on padding token indices. Mask values selected in
620
+ `[0, 1]`:
621
+
622
+ - 1 for tokens that are **not masked**,
623
+ - 0 for tokens that are **masked**.
624
+
625
+ [What are attention masks?](../glossary#attention-mask)
626
+ decoder_input_ids (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
627
+ Indices of decoder input sequence tokens in the vocabulary.
628
+
629
+ Indices can be obtained using [`WhisperTokenizer`]. See [`PreTrainedTokenizer.encode`] and
630
+ [`PreTrainedTokenizer.__call__`] for details.
631
+
632
+ [What are decoder input IDs?](../glossary#decoder-input-ids)
633
+
634
+ Whisper uses the `decoder_start_token_id` as the starting token for `decoder_input_ids` generation. If
635
+ `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
636
+ `past_key_values`).
637
+ decoder_attention_mask (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
638
+ Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
639
+ be used by default.
640
+
641
+ If you want to change padding behavior, you should read
642
+ [`modeling_whisper._prepare_decoder_attention_mask`] and modify to your needs. See diagram 1 in [the BART
643
+ paper](https://arxiv.org/abs/1910.13461) for more information on the default strategy.
644
+ head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
645
+ Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
646
+
647
+ - 1 indicates the head is **not masked**,
648
+ - 0 indicates the head is **masked**.
649
+
650
+ decoder_head_mask (`torch.Tensor` of shape `(decoder_layers, decoder_attention_heads)`, *optional*):
651
+ Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in `[0, 1]`:
652
+
653
+ - 1 indicates the head is **not masked**,
654
+ - 0 indicates the head is **masked**.
655
+
656
+ cross_attn_head_mask (`torch.Tensor` of shape `(decoder_layers, decoder_attention_heads)`, *optional*):
657
+ Mask to nullify selected heads of the cross-attention modules. Mask values selected in `[0, 1]`:
658
+
659
+ - 1 indicates the head is **not masked**,
660
+ - 0 indicates the head is **masked**.
661
+
662
+ encoder_outputs (`tuple(tuple(torch.FloatTensor)`, *optional*):
663
+ Tuple consists of (`last_hidden_state`, *optional*: `hidden_states`, *optional*: `attentions`)
664
+ `last_hidden_state` of shape `(batch_size, sequence_length, hidden_size)`, *optional*) is a sequence of
665
+ hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
666
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
667
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
668
+ `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
669
+ `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.
670
+
671
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
672
+ blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
673
+
674
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those that
675
+ don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of all
676
+ `decoder_input_ids` of shape `(batch_size, sequence_length)`.
677
+ decoder_inputs_embeds (`torch.FloatTensor` of shape `(batch_size, target_sequence_length, hidden_size)`, *optional*):
678
+ Optionally, instead of passing `decoder_input_ids` you can choose to directly pass an embedded
679
+ representation. If `past_key_values` is used, optionally only the last `decoder_inputs_embeds` have to be
680
+ input (see `past_key_values`). This is useful if you want more control over how to convert
681
+ `decoder_input_ids` indices into associated vectors than the model's internal embedding lookup matrix.
682
+ use_cache (`bool`, *optional*):
683
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
684
+ `past_key_values`).
685
+ output_attentions (`bool`, *optional*):
686
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
687
+ tensors for more detail.
688
+ output_hidden_states (`bool`, *optional*):
689
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
690
+ more detail.
691
+ return_dict (`bool`, *optional*):
692
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
693
+ """
694
+
695
+ WHISPER_ENCODER_INPUTS_DOCSTRING = r"""
696
+ Args:
697
+ input_features (`torch.FloatTensor` of shape `(batch_size, feature_size, sequence_length)`):
698
+ Float values mel features extracted from the raw speech waveform. Raw speech waveform can be obtained by
699
+ loading a `.flac` or `.wav` audio file into an array of type `List[float]` or a `numpy.ndarray`, *e.g.* via
700
+ the soundfile library (`pip install soundfile`). To prepare the array into `input_features`, the
701
+ [`AutoFeatureExtractor`] should be used for extracting the mel features, padding and conversion into a
702
+ tensor of type `torch.FloatTensor`. See [`~WhisperFeatureExtractor.__call__`]
703
+ head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
704
+ Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
705
+
706
+ - 1 indicates the head is **not masked**,
707
+ - 0 indicates the head is **masked**.
708
+ encoder_outputs (`tuple(tuple(torch.FloatTensor)`, *optional*):
709
+ Tuple consists of (`last_hidden_state`, *optional*: `hidden_states`, *optional*: `attentions`)
710
+ `last_hidden_state` of shape `(batch_size, sequence_length, hidden_size)`, *optional*) is a sequence of
711
+ hidden-states at the output of the last layer of the encoder.
712
+ output_attentions (`bool`, *optional*):
713
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
714
+ tensors for more detail.
715
+ output_hidden_states (`bool`, *optional*):
716
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
717
+ more detail.
718
+ return_dict (`bool`, *optional*):
719
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
720
+ """
721
+
722
+
723
+ class WhisperEncoder(WhisperPreTrainedModel):
724
+ """
725
+ Transformer encoder consisting of *config.encoder_layers* self attention layers. Each layer is a
726
+ [`WhisperEncoderLayer`].
727
+
728
+ Args:
729
+ config: WhisperConfig
730
+ """
731
+
732
+ def __init__(self, config: WhisperConfig):
733
+ super().__init__(config)
734
+ self.dropout = config.dropout
735
+ self.layerdrop = config.encoder_layerdrop
736
+
737
+ embed_dim = config.d_model
738
+ self.num_mel_bins = config.num_mel_bins
739
+ self.padding_idx = config.pad_token_id
740
+ self.max_source_positions = config.max_source_positions
741
+ self.embed_scale = math.sqrt(embed_dim) if config.scale_embedding else 1.0
742
+
743
+ self.conv1 = nn.Conv1d(self.num_mel_bins, embed_dim, kernel_size=3, padding=1)
744
+ self.conv2 = nn.Conv1d(embed_dim, embed_dim, kernel_size=3, stride=2, padding=1)
745
+
746
+ self.embed_positions = nn.Embedding(self.max_source_positions, embed_dim)
747
+
748
+ self.layers = nn.ModuleList([WhisperEncoderLayer(config) for _ in range(config.encoder_layers)])
749
+ self.layer_norm = nn.LayerNorm(config.d_model)
750
+
751
+ self.gradient_checkpointing = False
752
+ # Initialize weights and apply final processing
753
+ self.post_init()
754
+
755
+ def _freeze_parameters(self):
756
+ for param in self.parameters():
757
+ param.requires_grad = False
758
+ self._requires_grad = False
759
+
760
+ def get_input_embeddings(self) -> nn.Module:
761
+ return self.conv1
762
+
763
+ def set_input_embeddings(self, value: nn.Module):
764
+ self.conv1 = value
765
+
766
+ def forward(
767
+ self,
768
+ input_features,
769
+ attention_mask=None,
770
+ head_mask=None,
771
+ output_attentions=None,
772
+ output_hidden_states=None,
773
+ return_dict=None,
774
+ ):
775
+ r"""
776
+ Args:
777
+ input_features (`torch.LongTensor` of shape `(batch_size, feature_size, sequence_length)`):
778
+ Float values of mel features extracted from the raw speech waveform. Raw speech waveform can be
779
+ obtained by loading a `.flac` or `.wav` audio file into an array of type `List[float]` or a
780
+ `numpy.ndarray`, *e.g.* via the soundfile library (`pip install soundfile`). To prepare the array into
781
+ `input_features`, the [`AutoFeatureExtractor`] should be used for extracting the mel features, padding
782
+ and conversion into a tensor of type `torch.FloatTensor`. See [`~WhisperFeatureExtractor.__call__`]
783
+ attention_mask (`torch.Tensor`)`, *optional*):
784
+ Whisper does not support masking of the `input_features`, this argument is preserved for compatibility,
785
+ but it is not used. By default the silence in the input log mel spectrogram are ignored.
786
+ head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
787
+ Mask to nullify selected heads of the attention modules. Mask values selected in `[0, 1]`:
788
+
789
+ - 1 indicates the head is **not masked**,
790
+ - 0 indicates the head is **masked**.
791
+ output_attentions (`bool`, *optional*):
792
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
793
+ returned tensors for more detail.
794
+ output_hidden_states (`bool`, *optional*):
795
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
796
+ for more detail.
797
+ return_dict (`bool`, *optional*):
798
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
799
+ """
800
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
801
+ output_hidden_states = (
802
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
803
+ )
804
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
805
+ inputs_embeds = nn.functional.gelu(self.conv1(input_features))
806
+ inputs_embeds = nn.functional.gelu(self.conv2(inputs_embeds))
807
+
808
+ inputs_embeds = inputs_embeds.permute(0, 2, 1)
809
+ embed_pos = self.embed_positions.weight
810
+
811
+ hidden_states = inputs_embeds + embed_pos
812
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
813
+
814
+ encoder_states = () if output_hidden_states else None
815
+ all_attentions = () if output_attentions else None
816
+
817
+ # check if head_mask has a correct number of layers specified if desired
818
+ if head_mask is not None:
819
+ assert head_mask.size()[0] == (
820
+ len(self.layers)
821
+ ), f"The head_mask should be specified for {len(self.layers)} layers, but it is for {head_mask.size()[0]}."
822
+
823
+ for idx, encoder_layer in enumerate(self.layers):
824
+ if output_hidden_states:
825
+ encoder_states = encoder_states + (hidden_states,)
826
+ # add LayerDrop (see https://arxiv.org/abs/1909.11556 for description)
827
+ dropout_probability = random.uniform(0, 1)
828
+ if self.training and (dropout_probability < self.layerdrop): # skip the layer
829
+ layer_outputs = (None, None)
830
+ else:
831
+ if self.gradient_checkpointing and self.training:
832
+
833
+ def create_custom_forward(module):
834
+ def custom_forward(*inputs):
835
+ return module(*inputs, output_attentions)
836
+
837
+ return custom_forward
838
+
839
+ layer_outputs = torch.utils.checkpoint.checkpoint(
840
+ create_custom_forward(encoder_layer),
841
+ hidden_states,
842
+ None,
843
+ (head_mask[idx] if head_mask is not None else None),
844
+ )
845
+ else:
846
+ layer_outputs = encoder_layer(
847
+ hidden_states,
848
+ None,
849
+ layer_head_mask=(head_mask[idx] if head_mask is not None else None),
850
+ output_attentions=output_attentions,
851
+ )
852
+
853
+ hidden_states = layer_outputs[0]
854
+
855
+ if output_attentions:
856
+ all_attentions = all_attentions + (layer_outputs[1],)
857
+
858
+ hidden_states = self.layer_norm(hidden_states)
859
+ if output_hidden_states:
860
+ encoder_states = encoder_states + (hidden_states,)
861
+
862
+ if not return_dict:
863
+ return tuple(v for v in [hidden_states, encoder_states, all_attentions] if v is not None)
864
+ return BaseModelOutput(
865
+ last_hidden_state=hidden_states, hidden_states=encoder_states, attentions=all_attentions
866
+ )
867
+
868
+
869
+ class WhisperDecoder(WhisperPreTrainedModel):
870
+ """
871
+ Transformer decoder consisting of *config.decoder_layers* layers. Each layer is a [`WhisperDecoderLayer`]
872
+
873
+ Args:
874
+ config: WhisperConfig
875
+ """
876
+
877
+ def __init__(self, config: WhisperConfig):
878
+ super().__init__(config)
879
+ self.dropout = config.dropout
880
+ self.layerdrop = config.decoder_layerdrop
881
+ self.padding_idx = config.pad_token_id
882
+ self.max_target_positions = config.max_target_positions
883
+ self.max_source_positions = config.max_source_positions
884
+ self.embed_scale = math.sqrt(config.d_model) if config.scale_embedding else 1.0
885
+
886
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.d_model, self.padding_idx)
887
+ self.embed_positions = WhisperPositionalEmbedding(self.max_target_positions, config.d_model)
888
+
889
+ self.layers = nn.ModuleList([WhisperDecoderLayer(config) for _ in range(config.decoder_layers)])
890
+
891
+ self.layer_norm = nn.LayerNorm(config.d_model)
892
+
893
+ self.gradient_checkpointing = False
894
+ # Initialize weights and apply final processing
895
+ self.post_init()
896
+
897
+ def get_input_embeddings(self):
898
+ return self.embed_tokens
899
+
900
+ def set_input_embeddings(self, value):
901
+ self.embed_tokens = value
902
+
903
+ def _prepare_decoder_attention_mask(self, attention_mask, input_shape, inputs_embeds, past_key_values_length):
904
+ # create causal mask
905
+ # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
906
+ combined_attention_mask = None
907
+
908
+ if input_shape[-1] > 1:
909
+ combined_attention_mask = _make_causal_mask(
910
+ input_shape,
911
+ inputs_embeds.dtype,
912
+ device=inputs_embeds.device,
913
+ past_key_values_length=past_key_values_length,
914
+ )
915
+
916
+ if attention_mask is not None:
917
+ # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
918
+ expanded_attn_mask = _expand_mask(attention_mask, inputs_embeds.dtype, tgt_len=input_shape[-1])
919
+ combined_attention_mask = (
920
+ expanded_attn_mask if combined_attention_mask is None else expanded_attn_mask + combined_attention_mask
921
+ )
922
+
923
+ return combined_attention_mask
924
+
925
+ def forward(
926
+ self,
927
+ input_ids=None,
928
+ attention_mask=None,
929
+ encoder_hidden_states=None,
930
+ head_mask=None,
931
+ cross_attn_head_mask=None,
932
+ past_key_values=None,
933
+ inputs_embeds=None,
934
+ use_cache=None,
935
+ output_attentions=None,
936
+ output_hidden_states=None,
937
+ return_dict=None,
938
+ ):
939
+ r"""
940
+ Args:
941
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
942
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
943
+ provide it.
944
+
945
+ Indices can be obtained using [`WhisperTokenizer`]. See [`PreTrainedTokenizer.encode`] and
946
+ [`PreTrainedTokenizer.__call__`] for details.
947
+
948
+ [What are input IDs?](../glossary#input-ids)
949
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
950
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
951
+
952
+ - 1 for tokens that are **not masked**,
953
+ - 0 for tokens that are **masked**.
954
+
955
+ [What are attention masks?](../glossary#attention-mask)
956
+ encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, encoder_sequence_length, hidden_size)`, *optional*):
957
+ Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
958
+ of the decoder.
959
+ head_mask (`torch.Tensor` of shape `(decoder_layers, decoder_attention_heads)`, *optional*):
960
+ Mask to nullify selected heads of the attention modules. Mask values selected in `[0, 1]`:
961
+
962
+ - 1 indicates the head is **not masked**,
963
+ - 0 indicates the head is **masked**.
964
+
965
+ cross_attn_head_mask (`torch.Tensor` of shape `(decoder_layers, decoder_attention_heads)`, *optional*):
966
+ Mask to nullify selected heads of the attention modules in encoder to avoid performing cross-attention
967
+ on hidden heads. Mask values selected in `[0, 1]`:
968
+
969
+ - 1 indicates the head is **not masked**,
970
+ - 0 indicates the head is **masked**.
971
+
972
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
973
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
974
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of
975
+ shape `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.
976
+
977
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
978
+ cross-attention blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
979
+
980
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those
981
+ that don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of
982
+ all `decoder_input_ids` of shape `(batch_size, sequence_length)`. inputs_embeds (`torch.FloatTensor` of
983
+ shape `(batch_size, sequence_length, hidden_size)`, *optional*): Optionally, instead of passing
984
+ `input_ids` you can choose to directly pass an embedded representation. This is useful if you want more
985
+ control over how to convert `input_ids` indices into associated vectors than the model's internal
986
+ embedding lookup matrix.
987
+ output_attentions (`bool`, *optional*):
988
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
989
+ returned tensors for more detail.
990
+ output_hidden_states (`bool`, *optional*):
991
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
992
+ for more detail.
993
+ return_dict (`bool`, *optional*):
994
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
995
+ """
996
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
997
+ output_hidden_states = (
998
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
999
+ )
1000
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
1001
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1002
+
1003
+ # retrieve input_ids and inputs_embeds
1004
+ if input_ids is not None and inputs_embeds is not None:
1005
+ raise ValueError("You cannot specify both decoder_input_ids and decoder_inputs_embeds at the same time")
1006
+ elif input_ids is not None:
1007
+ input_shape = input_ids.size()
1008
+ input_ids = input_ids.view(-1, input_shape[-1])
1009
+ elif inputs_embeds is not None:
1010
+ input_shape = inputs_embeds.size()[:-1]
1011
+ else:
1012
+ raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
1013
+
1014
+ # past_key_values_length
1015
+ # MODIFIED: handle BOTH cache layouts — the MLA latent cache is 3-dim (bsz, seq, latent)
1016
+ # -> seq at dim 1; the stock MHA cache is 4-dim (bsz, heads, seq, head_dim) -> seq at
1017
+ # dim 2 (upstream hardcoded shape[1], which breaks stock incremental decoding).
1018
+ if past_key_values is not None:
1019
+ _first = past_key_values[0][0]
1020
+ past_key_values_length = _first.shape[1] if _first.dim() == 3 else _first.shape[2]
1021
+ else:
1022
+ past_key_values_length = 0
1023
+
1024
+ if inputs_embeds is None:
1025
+ inputs_embeds = self.embed_tokens(input_ids)
1026
+
1027
+ attention_mask = self._prepare_decoder_attention_mask(
1028
+ attention_mask, input_shape, inputs_embeds, past_key_values_length
1029
+ )
1030
+
1031
+ # embed positions
1032
+ if input_ids is not None:
1033
+ positions = self.embed_positions(input_ids, past_key_values_length=past_key_values_length)
1034
+ else:
1035
+ positions = self.embed_positions(inputs_embeds, past_key_values_length=past_key_values_length)
1036
+
1037
+ hidden_states = inputs_embeds + positions
1038
+ hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training)
1039
+
1040
+ if self.gradient_checkpointing and self.training:
1041
+ if use_cache:
1042
+ logger.warning_once(
1043
+ "`use_cache = True` is incompatible with gradient checkpointing. Setting `use_cache = False`..."
1044
+ )
1045
+ use_cache = False
1046
+ # decoder layers
1047
+ all_hidden_states = () if output_hidden_states else None
1048
+ all_self_attns = () if output_attentions else None
1049
+ all_cross_attentions = () if (output_attentions and encoder_hidden_states is not None) else None
1050
+ next_decoder_cache = () if use_cache else None
1051
+
1052
+ # check if head_mask/cross_attn_head_mask has a correct number of layers specified if desired
1053
+ for attn_mask, mask_name in zip([head_mask, cross_attn_head_mask], ["head_mask", "cross_attn_head_mask"]):
1054
+ if attn_mask is not None:
1055
+ assert attn_mask.size()[0] == (len(self.layers)), (
1056
+ f"The `{mask_name}` should be specified for {len(self.layers)} layers, but it is for"
1057
+ f" {head_mask.size()[0]}."
1058
+ )
1059
+ for idx, decoder_layer in enumerate(self.layers):
1060
+ # add LayerDrop (see https://arxiv.org/abs/1909.11556 for description)
1061
+ if output_hidden_states:
1062
+ all_hidden_states += (hidden_states,)
1063
+ dropout_probability = random.uniform(0, 1)
1064
+ if self.training and (dropout_probability < self.layerdrop):
1065
+ continue
1066
+
1067
+ past_key_value = past_key_values[idx] if past_key_values is not None else None
1068
+
1069
+ if self.gradient_checkpointing and self.training:
1070
+
1071
+ def create_custom_forward(module):
1072
+ def custom_forward(*inputs):
1073
+ # None for past_key_value
1074
+ return module(*inputs, output_attentions, use_cache)
1075
+
1076
+ return custom_forward
1077
+
1078
+ layer_outputs = torch.utils.checkpoint.checkpoint(
1079
+ create_custom_forward(decoder_layer),
1080
+ hidden_states,
1081
+ attention_mask,
1082
+ encoder_hidden_states,
1083
+ None, # encoder attention mask
1084
+ head_mask[idx] if head_mask is not None else None,
1085
+ cross_attn_head_mask[idx] if cross_attn_head_mask is not None else None,
1086
+ None, # past_key_value
1087
+ )
1088
+ else:
1089
+ layer_outputs = decoder_layer(
1090
+ hidden_states,
1091
+ attention_mask=attention_mask,
1092
+ encoder_hidden_states=encoder_hidden_states,
1093
+ layer_head_mask=(head_mask[idx] if head_mask is not None else None),
1094
+ cross_attn_layer_head_mask=(
1095
+ cross_attn_head_mask[idx] if cross_attn_head_mask is not None else None
1096
+ ),
1097
+ past_key_value=past_key_value,
1098
+ output_attentions=output_attentions,
1099
+ use_cache=use_cache,
1100
+ )
1101
+ hidden_states = layer_outputs[0]
1102
+
1103
+ if use_cache:
1104
+ next_decoder_cache += (layer_outputs[3 if output_attentions else 1],)
1105
+
1106
+ if output_attentions:
1107
+ all_self_attns += (layer_outputs[1],)
1108
+
1109
+ if encoder_hidden_states is not None:
1110
+ all_cross_attentions += (layer_outputs[2],)
1111
+
1112
+ hidden_states = self.layer_norm(hidden_states)
1113
+ # add hidden states from the last decoder layer
1114
+ if output_hidden_states:
1115
+ all_hidden_states += (hidden_states,)
1116
+
1117
+ next_cache = next_decoder_cache if use_cache else None
1118
+ if not return_dict:
1119
+ return tuple(
1120
+ v
1121
+ for v in [hidden_states, next_cache, all_hidden_states, all_self_attns, all_cross_attentions]
1122
+ if v is not None
1123
+ )
1124
+ return BaseModelOutputWithPastAndCrossAttentions(
1125
+ last_hidden_state=hidden_states,
1126
+ past_key_values=next_cache,
1127
+ hidden_states=all_hidden_states,
1128
+ attentions=all_self_attns,
1129
+ cross_attentions=all_cross_attentions,
1130
+ )
1131
+
1132
+
1133
+ @add_start_docstrings(
1134
+ "The bare Whisper Model outputting raw hidden-states without any specific head on top.",
1135
+ WHISPER_START_DOCSTRING,
1136
+ )
1137
+ class WhisperModel(WhisperPreTrainedModel):
1138
+ _keys_to_ignore_on_load_missing = [r"proj_out.weight"]
1139
+
1140
+ def __init__(self, config: WhisperConfig):
1141
+ super().__init__(config)
1142
+
1143
+ self.encoder = WhisperEncoder(config)
1144
+ self.decoder = WhisperDecoder(config)
1145
+ # Initialize weights and apply final processing
1146
+ self.post_init()
1147
+
1148
+ def get_input_embeddings(self):
1149
+ return self.decoder.embed_tokens
1150
+
1151
+ def set_input_embeddings(self, value):
1152
+ self.decoder.embed_tokens = value
1153
+
1154
+ def get_encoder(self):
1155
+ return self.encoder
1156
+
1157
+ def get_decoder(self):
1158
+ return self.decoder
1159
+
1160
+ def freeze_encoder(self):
1161
+ """
1162
+ Calling this function will disable the gradient computation for the Whisper encoder so that its parameters will
1163
+ not be updated during training.
1164
+ """
1165
+ self.encoder._freeze_parameters()
1166
+
1167
+ def _mask_input_features(
1168
+ self,
1169
+ input_features: torch.FloatTensor,
1170
+ attention_mask: Optional[torch.LongTensor] = None,
1171
+ ):
1172
+ """
1173
+ Masks extracted features along time axis and/or along feature axis according to
1174
+ [SpecAugment](https://arxiv.org/abs/1904.08779).
1175
+ """
1176
+
1177
+ # `config.apply_spec_augment` can set masking to False
1178
+ if not getattr(self.config, "apply_spec_augment", True):
1179
+ return input_features
1180
+
1181
+ # generate indices & apply SpecAugment along time axis
1182
+ batch_size, hidden_size, sequence_length = input_features.size()
1183
+
1184
+ if self.config.mask_time_prob > 0 and self.training:
1185
+ # generate indices & apply SpecAugment along time axis
1186
+ mask_time_indices = _compute_mask_indices(
1187
+ (batch_size, sequence_length),
1188
+ mask_prob=self.config.mask_time_prob,
1189
+ mask_length=self.config.mask_time_length,
1190
+ attention_mask=attention_mask,
1191
+ min_masks=self.config.mask_time_min_masks,
1192
+ )
1193
+ mask_time_indices = torch.tensor(mask_time_indices, device=input_features.device, dtype=torch.bool)
1194
+ mask_time_indices = mask_time_indices[:, None].expand(-1, hidden_size, -1)
1195
+ input_features[mask_time_indices] = 0
1196
+
1197
+ if self.config.mask_feature_prob > 0 and self.training:
1198
+ # generate indices & apply SpecAugment along feature axis
1199
+ mask_feature_indices = _compute_mask_indices(
1200
+ (batch_size, hidden_size),
1201
+ mask_prob=self.config.mask_feature_prob,
1202
+ mask_length=self.config.mask_feature_length,
1203
+ min_masks=self.config.mask_feature_min_masks,
1204
+ )
1205
+ mask_feature_indices = torch.tensor(mask_feature_indices, device=input_features.device, dtype=torch.bool)
1206
+ input_features[mask_feature_indices] = 0
1207
+
1208
+ return input_features
1209
+
1210
+ @add_start_docstrings_to_model_forward(WHISPER_INPUTS_DOCSTRING)
1211
+ @replace_return_docstrings(output_type=Seq2SeqModelOutput, config_class=_CONFIG_FOR_DOC)
1212
+ def forward(
1213
+ self,
1214
+ input_features: Optional[torch.FloatTensor] = None,
1215
+ attention_mask: Optional[torch.LongTensor] = None,
1216
+ decoder_input_ids: Optional[torch.LongTensor] = None,
1217
+ decoder_attention_mask: Optional[torch.LongTensor] = None,
1218
+ head_mask: Optional[torch.Tensor] = None,
1219
+ decoder_head_mask: Optional[torch.Tensor] = None,
1220
+ cross_attn_head_mask: Optional[torch.Tensor] = None,
1221
+ encoder_outputs: Optional[Tuple[Tuple[torch.FloatTensor]]] = None,
1222
+ past_key_values: Optional[Tuple[Tuple[torch.FloatTensor]]] = None,
1223
+ decoder_inputs_embeds: Optional[Tuple[torch.FloatTensor]] = None,
1224
+ use_cache: Optional[bool] = None,
1225
+ output_attentions: Optional[bool] = None,
1226
+ output_hidden_states: Optional[bool] = None,
1227
+ return_dict: Optional[bool] = None,
1228
+ ) -> Union[Tuple[torch.Tensor], Seq2SeqModelOutput]:
1229
+ r"""
1230
+ Returns:
1231
+
1232
+ Example:
1233
+ ```python
1234
+ >>> import torch
1235
+ >>> from transformers import AutoFeatureExtractor, WhisperModel
1236
+ >>> from datasets import load_dataset
1237
+
1238
+ >>> model = WhisperModel.from_pretrained("openai/whisper-base")
1239
+ >>> feature_extractor = AutoFeatureExtractor.from_pretrained("openai/whisper-base")
1240
+ >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
1241
+ >>> inputs = feature_extractor(ds[0]["audio"]["array"], return_tensors="pt")
1242
+ >>> input_features = inputs.input_features
1243
+ >>> decoder_input_ids = torch.tensor([[1, 1]]) * model.config.decoder_start_token_id
1244
+ >>> last_hidden_state = model(input_features, decoder_input_ids=decoder_input_ids).last_hidden_state
1245
+ >>> list(last_hidden_state.shape)
1246
+ [1, 2, 512]
1247
+ ```"""
1248
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
1249
+ output_hidden_states = (
1250
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
1251
+ )
1252
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
1253
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1254
+
1255
+ if encoder_outputs is None:
1256
+ input_features = self._mask_input_features(input_features, attention_mask=attention_mask)
1257
+
1258
+ encoder_outputs = self.encoder(
1259
+ input_features,
1260
+ head_mask=head_mask,
1261
+ output_attentions=output_attentions,
1262
+ output_hidden_states=output_hidden_states,
1263
+ return_dict=return_dict,
1264
+ )
1265
+ # If the user passed a tuple for encoder_outputs, we wrap it in a BaseModelOutput when return_dict=True
1266
+ elif return_dict and not isinstance(encoder_outputs, BaseModelOutput):
1267
+ encoder_outputs = BaseModelOutput(
1268
+ last_hidden_state=encoder_outputs[0],
1269
+ hidden_states=encoder_outputs[1] if len(encoder_outputs) > 1 else None,
1270
+ attentions=encoder_outputs[2] if len(encoder_outputs) > 2 else None,
1271
+ )
1272
+
1273
+ # decoder outputs consists of (dec_features, past_key_value, dec_hidden, dec_attn)
1274
+ decoder_outputs = self.decoder(
1275
+ input_ids=decoder_input_ids,
1276
+ attention_mask=decoder_attention_mask,
1277
+ encoder_hidden_states=encoder_outputs[0],
1278
+ head_mask=decoder_head_mask,
1279
+ cross_attn_head_mask=cross_attn_head_mask,
1280
+ past_key_values=past_key_values,
1281
+ inputs_embeds=decoder_inputs_embeds,
1282
+ use_cache=use_cache,
1283
+ output_attentions=output_attentions,
1284
+ output_hidden_states=output_hidden_states,
1285
+ return_dict=return_dict,
1286
+ )
1287
+
1288
+ if not return_dict:
1289
+ return decoder_outputs + encoder_outputs
1290
+
1291
+ return Seq2SeqModelOutput(
1292
+ last_hidden_state=decoder_outputs.last_hidden_state,
1293
+ past_key_values=decoder_outputs.past_key_values,
1294
+ decoder_hidden_states=decoder_outputs.hidden_states,
1295
+ decoder_attentions=decoder_outputs.attentions,
1296
+ cross_attentions=decoder_outputs.cross_attentions,
1297
+ encoder_last_hidden_state=encoder_outputs.last_hidden_state,
1298
+ encoder_hidden_states=encoder_outputs.hidden_states,
1299
+ encoder_attentions=encoder_outputs.attentions,
1300
+ )
1301
+
1302
+
1303
+ @add_start_docstrings(
1304
+ "The Whisper Model with a language modeling head. Can be used for automatic speech recognition.",
1305
+ WHISPER_START_DOCSTRING,
1306
+ )
1307
+ class WhisperForConditionalGeneration(WhisperPreTrainedModel):
1308
+ base_model_prefix = "model"
1309
+ _keys_to_ignore_on_load_missing = [
1310
+ r"encoder.version",
1311
+ r"decoder.version",
1312
+ r"proj_out.weight",
1313
+ ]
1314
+ _keys_to_ignore_on_save = [
1315
+ r"proj_out.weight",
1316
+ ]
1317
+
1318
+ def __init__(self, config: WhisperConfig):
1319
+ super().__init__(config)
1320
+ self.model = WhisperModel(config)
1321
+ self.proj_out = nn.Linear(config.d_model, config.vocab_size, bias=False)
1322
+
1323
+ # Initialize weights and apply final processing
1324
+ self.post_init()
1325
+
1326
+ def get_encoder(self):
1327
+ return self.model.get_encoder()
1328
+
1329
+ def get_decoder(self):
1330
+ return self.model.get_decoder()
1331
+
1332
+ def resize_token_embeddings(self, new_num_tokens: int) -> nn.Embedding:
1333
+ new_embeddings = super().resize_token_embeddings(new_num_tokens)
1334
+ return new_embeddings
1335
+
1336
+ def get_output_embeddings(self):
1337
+ return self.proj_out
1338
+
1339
+ def set_output_embeddings(self, new_embeddings):
1340
+ self.proj_out = new_embeddings
1341
+
1342
+ def get_input_embeddings(self) -> nn.Module:
1343
+ return self.model.get_input_embeddings()
1344
+
1345
+ def freeze_encoder(self):
1346
+ """
1347
+ Calling this function will disable the gradient computation for the Whisper encoder so that its parameters will
1348
+ not be updated during training.
1349
+ """
1350
+ self.model.encoder._freeze_parameters()
1351
+
1352
+ @add_start_docstrings_to_model_forward(WHISPER_INPUTS_DOCSTRING)
1353
+ @replace_return_docstrings(output_type=Seq2SeqLMOutput, config_class=_CONFIG_FOR_DOC)
1354
+ def forward(
1355
+ self,
1356
+ input_features: Optional[torch.FloatTensor] = None,
1357
+ attention_mask: Optional[torch.LongTensor] = None,
1358
+ decoder_input_ids: Optional[torch.LongTensor] = None,
1359
+ decoder_attention_mask: Optional[torch.LongTensor] = None,
1360
+ head_mask: Optional[torch.Tensor] = None,
1361
+ decoder_head_mask: Optional[torch.Tensor] = None,
1362
+ cross_attn_head_mask: Optional[torch.Tensor] = None,
1363
+ encoder_outputs: Optional[Tuple[Tuple[torch.FloatTensor]]] = None,
1364
+ past_key_values: Optional[Tuple[Tuple[torch.FloatTensor]]] = None,
1365
+ decoder_inputs_embeds: Optional[Tuple[torch.FloatTensor]] = None,
1366
+ labels: Optional[torch.LongTensor] = None,
1367
+ use_cache: Optional[bool] = None,
1368
+ output_attentions: Optional[bool] = None,
1369
+ output_hidden_states: Optional[bool] = None,
1370
+ return_dict: Optional[bool] = None,
1371
+ ) -> Union[Tuple[torch.Tensor], Seq2SeqLMOutput]:
1372
+ r"""
1373
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1374
+ Labels for computing the language modeling loss. Indices should either be in `[0, ..., config.vocab_size]`
1375
+ or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored (masked), the loss is
1376
+ only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
1377
+
1378
+ Returns:
1379
+
1380
+ Example:
1381
+
1382
+ ```python
1383
+ >>> import torch
1384
+ >>> from transformers import AutoProcessor, WhisperForConditionalGeneration
1385
+ >>> from datasets import load_dataset
1386
+
1387
+ >>> processor = AutoProcessor.from_pretrained("openai/whisper-tiny.en")
1388
+ >>> model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-tiny.en")
1389
+
1390
+ >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
1391
+
1392
+ >>> inputs = processor(ds[0]["audio"]["array"], return_tensors="pt")
1393
+ >>> input_features = inputs.input_features
1394
+
1395
+ >>> generated_ids = model.generate(inputs=input_features)
1396
+
1397
+ >>> transcription = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
1398
+ >>> transcription
1399
+ ' Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel.'
1400
+ ```"""
1401
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1402
+
1403
+ if labels is not None:
1404
+ if decoder_input_ids is None and decoder_inputs_embeds is None:
1405
+ decoder_input_ids = shift_tokens_right(
1406
+ labels, self.config.pad_token_id, self.config.decoder_start_token_id
1407
+ )
1408
+
1409
+ outputs = self.model(
1410
+ input_features,
1411
+ attention_mask=attention_mask,
1412
+ decoder_input_ids=decoder_input_ids,
1413
+ encoder_outputs=encoder_outputs,
1414
+ decoder_attention_mask=decoder_attention_mask,
1415
+ head_mask=head_mask,
1416
+ decoder_head_mask=decoder_head_mask,
1417
+ cross_attn_head_mask=cross_attn_head_mask,
1418
+ past_key_values=past_key_values,
1419
+ decoder_inputs_embeds=decoder_inputs_embeds,
1420
+ use_cache=use_cache,
1421
+ output_attentions=output_attentions,
1422
+ output_hidden_states=output_hidden_states,
1423
+ return_dict=return_dict,
1424
+ )
1425
+ lm_logits = self.proj_out(outputs[0])
1426
+
1427
+ loss = None
1428
+ if labels is not None:
1429
+ loss_fct = CrossEntropyLoss()
1430
+ # move labels to correct device to enable PP
1431
+ labels = labels.to(lm_logits.device)
1432
+ loss = loss_fct(lm_logits.view(-1, self.config.vocab_size), labels.reshape(-1))
1433
+
1434
+ if not return_dict:
1435
+ output = (lm_logits,) + outputs[1:]
1436
+ return ((loss,) + output) if loss is not None else output
1437
+
1438
+ return Seq2SeqLMOutput(
1439
+ loss=loss,
1440
+ logits=lm_logits,
1441
+ past_key_values=outputs.past_key_values,
1442
+ decoder_hidden_states=outputs.decoder_hidden_states,
1443
+ decoder_attentions=outputs.decoder_attentions,
1444
+ cross_attentions=outputs.cross_attentions,
1445
+ encoder_last_hidden_state=outputs.encoder_last_hidden_state,
1446
+ encoder_hidden_states=outputs.encoder_hidden_states,
1447
+ encoder_attentions=outputs.encoder_attentions,
1448
+ )
1449
+
1450
+ def generate(
1451
+ self,
1452
+ inputs: Optional[torch.Tensor] = None,
1453
+ generation_config=None,
1454
+ logits_processor=None,
1455
+ stopping_criteria=None,
1456
+ prefix_allowed_tokens_fn=None,
1457
+ synced_gpus=False,
1458
+ return_timestamps=None,
1459
+ task=None,
1460
+ language=None,
1461
+ is_multilingual=None,
1462
+ **kwargs,
1463
+ ):
1464
+ """
1465
+
1466
+ Generates sequences of token ids for models with a language modeling head.
1467
+
1468
+ <Tip warning={true}>
1469
+
1470
+ Most generation-controlling parameters are set in `generation_config` which, if not passed, will be set to the
1471
+ model's default generation configuration. You can override any `generation_config` by passing the corresponding
1472
+ parameters to generate(), e.g. `.generate(inputs, num_beams=4, do_sample=True)`.
1473
+
1474
+ For an overview of generation strategies and code examples, check out the [following
1475
+ guide](./generation_strategies).
1476
+
1477
+ </Tip>
1478
+
1479
+ Parameters:
1480
+ inputs (`torch.Tensor` of varying shape depending on the modality, *optional*):
1481
+ The sequence used as a prompt for the generation or as model inputs to the encoder. If `None` the
1482
+ method initializes it with `bos_token_id` and a batch size of 1. For decoder-only models `inputs`
1483
+ should of in the format of `input_ids`. For encoder-decoder models *inputs* can represent any of
1484
+ `input_ids`, `input_values`, `input_features`, or `pixel_values`.
1485
+ generation_config (`~generation.GenerationConfig`, *optional*):
1486
+ The generation configuration to be used as base parametrization for the generation call. `**kwargs`
1487
+ passed to generate matching the attributes of `generation_config` will override them. If
1488
+ `generation_config` is not provided, the default will be used, which had the following loading
1489
+ priority: 1) from the `generation_config.json` model file, if it exists; 2) from the model
1490
+ configuration. Please note that unspecified parameters will inherit [`~generation.GenerationConfig`]'s
1491
+ default values, whose documentation should be checked to parameterize generation.
1492
+ logits_processor (`LogitsProcessorList`, *optional*):
1493
+ Custom logits processors that complement the default logits processors built from arguments and
1494
+ generation config. If a logit processor is passed that is already created with the arguments or a
1495
+ generation config an error is thrown. This feature is intended for advanced users.
1496
+ stopping_criteria (`StoppingCriteriaList`, *optional*):
1497
+ Custom stopping criteria that complement the default stopping criteria built from arguments and a
1498
+ generation config. If a stopping criteria is passed that is already created with the arguments or a
1499
+ generation config an error is thrown. This feature is intended for advanced users.
1500
+ prefix_allowed_tokens_fn (`Callable[[int, torch.Tensor], List[int]]`, *optional*):
1501
+ If provided, this function constraints the beam search to allowed tokens only at each step. If not
1502
+ provided no constraint is applied. This function takes 2 arguments: the batch ID `batch_id` and
1503
+ `input_ids`. It has to return a list with the allowed tokens for the next generation step conditioned
1504
+ on the batch ID `batch_id` and the previously generated tokens `inputs_ids`. This argument is useful
1505
+ for constrained generation conditioned on the prefix, as described in [Autoregressive Entity
1506
+ Retrieval](https://arxiv.org/abs/2010.00904).
1507
+ synced_gpus (`bool`, *optional*, defaults to `False`):
1508
+ Whether to continue running the while loop until max_length (needed for ZeRO stage 3)
1509
+ return_timestamps (`bool`, *optional*):
1510
+ Whether to return the timestamps with the text. This enables the `WhisperTimestampsLogitsProcessor`.
1511
+ task (`bool`, *optional*):
1512
+ Task to use for generation, either "translate" or "transcribe". The `model.config.forced_decoder_ids`
1513
+ will be updated accordingly.
1514
+ language (`bool`, *optional*):
1515
+ Language token to use for generation, can be either in the form of `<|en|>`, `en` or `english`. You can
1516
+ find all the possible language tokens in the `model.generation_config.lang_to_id` dictionary.
1517
+ is_multilingual (`bool`, *optional*):
1518
+ Whether or not the model is multilingual.
1519
+ kwargs:
1520
+ Ad hoc parametrization of `generate_config` and/or additional model-specific kwargs that will be
1521
+ forwarded to the `forward` function of the model. If the model is an encoder-decoder model, encoder
1522
+ specific kwargs should not be prefixed and decoder specific kwargs should be prefixed with *decoder_*.
1523
+
1524
+ Return:
1525
+ [`~utils.ModelOutput`] or `torch.LongTensor`: A [`~utils.ModelOutput`] (if `return_dict_in_generate=True`
1526
+ or when `config.return_dict_in_generate=True`) or a `torch.FloatTensor`.
1527
+
1528
+ If the model is *not* an encoder-decoder model (`model.config.is_encoder_decoder=False`), the possible
1529
+ [`~utils.ModelOutput`] types are:
1530
+
1531
+ - [`~generation.GreedySearchDecoderOnlyOutput`],
1532
+ - [`~generation.SampleDecoderOnlyOutput`],
1533
+ - [`~generation.BeamSearchDecoderOnlyOutput`],
1534
+ - [`~generation.BeamSampleDecoderOnlyOutput`]
1535
+
1536
+ If the model is an encoder-decoder model (`model.config.is_encoder_decoder=True`), the possible
1537
+ [`~utils.ModelOutput`] types are:
1538
+
1539
+ - [`~generation.GreedySearchEncoderDecoderOutput`],
1540
+ - [`~generation.SampleEncoderDecoderOutput`],
1541
+ - [`~generation.BeamSearchEncoderDecoderOutput`],
1542
+ - [`~generation.BeamSampleEncoderDecoderOutput`]
1543
+ """
1544
+ if generation_config is None:
1545
+ generation_config = self.generation_config
1546
+
1547
+ if return_timestamps is not None:
1548
+ if not hasattr(generation_config, "no_timestamps_token_id"):
1549
+ raise ValueError(
1550
+ "You are trying to return timestamps, but the generation config is not properly set."
1551
+ "Make sure to initialize the generation config with the correct attributes that are needed such as `no_timestamps_token_id`."
1552
+ "For more details on how to generate the approtiate config, refer to https://github.com/huggingface/transformers/issues/21878#issuecomment-1451902363"
1553
+ )
1554
+
1555
+ generation_config.return_timestamps = return_timestamps
1556
+ else:
1557
+ generation_config.return_timestamps = False
1558
+
1559
+ if language is not None:
1560
+ language = language.lower()
1561
+ generation_config.language = language
1562
+ if task is not None:
1563
+ generation_config.task = task
1564
+
1565
+ forced_decoder_ids = []
1566
+ if task is not None or language is not None:
1567
+ if hasattr(generation_config, "language"):
1568
+ if generation_config.language in generation_config.lang_to_id.keys():
1569
+ language_token = generation_config.language
1570
+ elif generation_config.language in TO_LANGUAGE_CODE.keys():
1571
+ language_token = f"<|{TO_LANGUAGE_CODE[generation_config.language]}|>"
1572
+ elif generation_config.language in TO_LANGUAGE_CODE.values():
1573
+ language_token = f"<|{generation_config.language}|>"
1574
+ else:
1575
+ is_language_code = len(generation_config.language) == 2
1576
+ raise ValueError(
1577
+ f"Unsupported language: {generation_config.language}. Language should be one of:"
1578
+ f" {list(TO_LANGUAGE_CODE.values()) if is_language_code else list(TO_LANGUAGE_CODE.keys())}."
1579
+ )
1580
+ forced_decoder_ids.append((1, generation_config.lang_to_id[language_token]))
1581
+ else:
1582
+ forced_decoder_ids.append((1, None)) # automatically detect the language
1583
+
1584
+ if hasattr(generation_config, "task"):
1585
+ if generation_config.task in TASK_IDS:
1586
+ forced_decoder_ids.append((2, generation_config.task_to_id[generation_config.task]))
1587
+ else:
1588
+ raise ValueError(
1589
+ f"The `{generation_config.task}`task is not supported. The task should be one of `{TASK_IDS}`"
1590
+ )
1591
+ else:
1592
+ forced_decoder_ids.append((2, generation_config.task_to_id["transcribe"])) # defaults to transcribe
1593
+ if hasattr(generation_config, "no_timestamps_token_id") and not generation_config.return_timestamps:
1594
+ idx = forced_decoder_ids[-1][0] + 1 if forced_decoder_ids else 1
1595
+ forced_decoder_ids.append((idx, generation_config.no_timestamps_token_id))
1596
+
1597
+ # Legacy code for backward compatibility
1598
+ elif hasattr(self.config, "forced_decoder_ids") and self.config.forced_decoder_ids is not None:
1599
+ forced_decoder_ids = self.config.forced_decoder_ids
1600
+ elif (
1601
+ hasattr(self.generation_config, "forced_decoder_ids")
1602
+ and self.generation_config.forced_decoder_ids is not None
1603
+ ):
1604
+ forced_decoder_ids = self.generation_config.forced_decoder_ids
1605
+
1606
+ if generation_config.return_timestamps:
1607
+ logits_processor = [WhisperTimeStampLogitsProcessor(generation_config)]
1608
+
1609
+ if len(forced_decoder_ids) > 0:
1610
+ generation_config.forced_decoder_ids = forced_decoder_ids
1611
+
1612
+ return super().generate(
1613
+ inputs,
1614
+ generation_config,
1615
+ logits_processor,
1616
+ stopping_criteria,
1617
+ prefix_allowed_tokens_fn,
1618
+ synced_gpus,
1619
+ **kwargs,
1620
+ )
1621
+
1622
+ def prepare_inputs_for_generation(
1623
+ self,
1624
+ decoder_input_ids,
1625
+ past_key_values=None,
1626
+ use_cache=None,
1627
+ encoder_outputs=None,
1628
+ attention_mask=None,
1629
+ **kwargs,
1630
+ ):
1631
+ # cut decoder_input_ids if past is used
1632
+ if past_key_values is not None:
1633
+ decoder_input_ids = decoder_input_ids[:, -1:]
1634
+
1635
+ return {
1636
+ "encoder_outputs": encoder_outputs,
1637
+ "past_key_values": past_key_values,
1638
+ "decoder_input_ids": decoder_input_ids,
1639
+ "use_cache": use_cache,
1640
+ "decoder_attention_mask": None,
1641
+ }
1642
+
1643
+ #
1644
+ @staticmethod
1645
+ def _reorder_cache(past_key_values, beam_idx):
1646
+ reordered_past = ()
1647
+ for layer_past in past_key_values:
1648
+ reordered_past += (tuple(past_state.index_select(0, beam_idx) for past_state in layer_past),)
1649
+ return reordered_past
1650
+
1651
+
1652
+ @add_start_docstrings(
1653
+ """
1654
+ Whisper Encoder Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
1655
+ like SUPERB Keyword Spotting.
1656
+ """,
1657
+ WHISPER_ENCODER_INPUTS_DOCSTRING,
1658
+ )
1659
+ class WhisperForAudioClassification(WhisperPreTrainedModel):
1660
+ def __init__(self, config):
1661
+ super().__init__(config)
1662
+
1663
+ self.encoder = WhisperEncoder(config)
1664
+ num_layers = config.num_hidden_layers + 1 # transformer layers + input embeddings
1665
+ if config.use_weighted_layer_sum:
1666
+ self.layer_weights = nn.Parameter(torch.ones(num_layers) / num_layers)
1667
+ self.projector = nn.Linear(config.hidden_size, config.classifier_proj_size)
1668
+ self.classifier = nn.Linear(config.classifier_proj_size, config.num_labels)
1669
+
1670
+ # Initialize weights and apply final processing
1671
+ self.post_init()
1672
+
1673
+ def freeze_encoder(self):
1674
+ """
1675
+ Calling this function will disable the gradient computation for the Whisper encoder so that its parameters will
1676
+ not be updated during training. Only the projection layers and classification head will be updated.
1677
+ """
1678
+ self.encoder._freeze_parameters()
1679
+
1680
+ def get_input_embeddings(self) -> nn.Module:
1681
+ return self.encoder.get_input_embeddings()
1682
+
1683
+ def set_input_embeddings(self, value: nn.Module):
1684
+ self.encoder.set_input_embeddings(value)
1685
+
1686
+ @add_start_docstrings_to_model_forward(WHISPER_ENCODER_INPUTS_DOCSTRING)
1687
+ @replace_return_docstrings(output_type=SequenceClassifierOutput, config_class=_CONFIG_FOR_DOC)
1688
+ def forward(
1689
+ self,
1690
+ input_features: Optional[torch.LongTensor] = None,
1691
+ head_mask: Optional[torch.Tensor] = None,
1692
+ encoder_outputs: Optional[Tuple[Tuple[torch.FloatTensor]]] = None,
1693
+ labels: Optional[torch.LongTensor] = None,
1694
+ output_attentions: Optional[bool] = None,
1695
+ output_hidden_states: Optional[bool] = None,
1696
+ return_dict: Optional[bool] = None,
1697
+ ) -> Union[Tuple[torch.Tensor], SequenceClassifierOutput]:
1698
+ r"""
1699
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1700
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1701
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1702
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1703
+
1704
+ Returns:
1705
+
1706
+ Example:
1707
+
1708
+ ```python
1709
+ >>> import torch
1710
+ >>> from transformers import AutoFeatureExtractor, WhisperForAudioClassification
1711
+ >>> from datasets import load_dataset
1712
+
1713
+ >>> feature_extractor = AutoFeatureExtractor.from_pretrained("sanchit-gandhi/whisper-medium-fleurs-lang-id")
1714
+ >>> model = WhisperForAudioClassification.from_pretrained("sanchit-gandhi/whisper-medium-fleurs-lang-id")
1715
+
1716
+ >>> ds = load_dataset("google/fleurs", "all", split="validation", streaming=True)
1717
+ >>> sample = next(iter(ds))
1718
+
1719
+ >>> inputs = feature_extractor(
1720
+ ... sample["audio"]["array"], sampling_rate=sample["audio"]["sampling_rate"], return_tensors="pt"
1721
+ ... )
1722
+ >>> input_features = inputs.input_features
1723
+
1724
+ >>> with torch.no_grad():
1725
+ ... logits = model(input_features).logits
1726
+
1727
+ >>> predicted_class_ids = torch.argmax(logits).item()
1728
+ >>> predicted_label = model.config.id2label[predicted_class_ids]
1729
+ >>> predicted_label
1730
+ 'af_za'
1731
+ ```"""
1732
+
1733
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
1734
+ output_hidden_states = (
1735
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
1736
+ )
1737
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1738
+
1739
+ if encoder_outputs is None:
1740
+ encoder_outputs = self.encoder(
1741
+ input_features,
1742
+ head_mask=head_mask,
1743
+ output_attentions=output_attentions,
1744
+ output_hidden_states=output_hidden_states,
1745
+ return_dict=return_dict,
1746
+ )
1747
+
1748
+ if self.config.use_weighted_layer_sum:
1749
+ hidden_states = torch.stack(encoder_outputs, dim=1)
1750
+ norm_weights = nn.functional.softmax(self.layer_weights, dim=-1)
1751
+ hidden_states = (hidden_states * norm_weights.view(-1, 1, 1)).sum(dim=1)
1752
+ else:
1753
+ hidden_states = encoder_outputs[0]
1754
+
1755
+ hidden_states = self.projector(hidden_states)
1756
+ pooled_output = hidden_states.mean(dim=1)
1757
+
1758
+ logits = self.classifier(pooled_output)
1759
+
1760
+ loss = None
1761
+
1762
+ if labels is not None:
1763
+ loss_fct = CrossEntropyLoss()
1764
+ # move labels to correct device to enable PP
1765
+ labels = labels.to(logits.device)
1766
+ loss = loss_fct(logits.view(-1, self.config.num_labels), labels.view(-1))
1767
+
1768
+ if not return_dict:
1769
+ output = (logits,) + encoder_outputs[1:]
1770
+ return ((loss,) + output) if loss is not None else output
1771
+
1772
+ return SequenceClassifierOutput(
1773
+ loss=loss,
1774
+ logits=logits,
1775
+ hidden_states=encoder_outputs.hidden_states,
1776
+ attentions=encoder_outputs.attentions,
1777
+ )
modeling_whisper_mla.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """WhisperMLA — Whisper with MLA (multi-head latent attention) converted decoder attention.
2
+
3
+ Standalone trust_remote_code modeling: builds the MLA architecture structurally at init (the
4
+ converted modules' weights then come from the checkpoint), so
5
+ ``AutoModelForSpeechSeq2Seq.from_pretrained(repo, trust_remote_code=True)`` just works.
6
+ Pinned to transformers==4.46.x (the sibling vendored modeling targets it).
7
+
8
+ Adapted from Whisper-MLA / MHA2MLA (Apache-2.0); see the repo NOTICE.
9
+ """
10
+ import types
11
+ from types import SimpleNamespace
12
+
13
+ from .configuration_whisper_mla import WhisperMLAConfig
14
+ from .modeling_whisper import WhisperAttention, WhisperForConditionalGeneration
15
+
16
+ # NOTE: patch_func is imported directly (not only transitively) so the HF dynamic-module loader
17
+ # copies it into the modules cache — it scans the ENTRY file's `from .x import y` lines.
18
+ from .patch_func import svd_low_rank_approx as _ensure_patch_func_is_bundled # noqa: F401
19
+ from .patching_model_load import patch_model
20
+ from .patching_whisper import (
21
+ custom_WhisperAttention_mla_forward,
22
+ custom_WhisperAttention_nosplit_forward,
23
+ )
24
+
25
+ _SCOPE_TARGETS = {
26
+ "decoder_self": frozenset({"decoder_self"}),
27
+ "plus_cross": frozenset({"decoder_self", "decoder_cross"}),
28
+ "all": frozenset({"decoder_self", "decoder_cross", "encoder_self"}),
29
+ }
30
+
31
+
32
+ def _structural_convert(model, config: WhisperMLAConfig) -> None:
33
+ """Rebuild the attention modules as MLA per the config. Runs on the freshly-initialized model
34
+ inside __init__ — the SVD of the (random) init weights only shapes the modules; real weights
35
+ arrive from the checkpoint via from_pretrained's state-dict load."""
36
+ if getattr(config, "num_key_value_heads", None) is None:
37
+ config.num_key_value_heads = config.encoder_attention_heads
38
+ preserve = config.mla_scheme == "partial_preservation"
39
+ args = SimpleNamespace(
40
+ rope_dim_for_mla=config.mla_rope_dim,
41
+ partial_rope_version={"uniform": "uniform", "2_norm": "2-norm"}[config.mla_selection],
42
+ low_rank=config.mla_low_rank,
43
+ svd_init_method="joint",
44
+ is_gqa2mha2mla=False,
45
+ uniform_start_point=0,
46
+ is_mla_from_scratch=False,
47
+ qk_tensor_path=None,
48
+ preserve_rope=preserve,
49
+ targets=set(_SCOPE_TARGETS[config.mla_scope]),
50
+ )
51
+ patch_model(model, config, args)
52
+ forward = custom_WhisperAttention_mla_forward if preserve else custom_WhisperAttention_nosplit_forward
53
+ for module in model.modules():
54
+ if isinstance(module, WhisperAttention) and hasattr(module, "kv_proj"):
55
+ module.forward = types.MethodType(forward, module)
56
+
57
+
58
+ class WhisperMLAForConditionalGeneration(WhisperForConditionalGeneration):
59
+ config_class = WhisperMLAConfig
60
+
61
+ def __init__(self, config: WhisperMLAConfig):
62
+ super().__init__(config)
63
+ if config.mla_scheme != "none":
64
+ _structural_convert(self, config)
normalizer.json ADDED
@@ -0,0 +1,1742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "accessorise": "accessorize",
3
+ "accessorised": "accessorized",
4
+ "accessorises": "accessorizes",
5
+ "accessorising": "accessorizing",
6
+ "acclimatisation": "acclimatization",
7
+ "acclimatise": "acclimatize",
8
+ "acclimatised": "acclimatized",
9
+ "acclimatises": "acclimatizes",
10
+ "acclimatising": "acclimatizing",
11
+ "accoutrements": "accouterments",
12
+ "aeon": "eon",
13
+ "aeons": "eons",
14
+ "aerogramme": "aerogram",
15
+ "aerogrammes": "aerograms",
16
+ "aeroplane": "airplane",
17
+ "aeroplanes": "airplanes",
18
+ "aesthete": "esthete",
19
+ "aesthetes": "esthetes",
20
+ "aesthetic": "esthetic",
21
+ "aesthetically": "esthetically",
22
+ "aesthetics": "esthetics",
23
+ "aetiology": "etiology",
24
+ "ageing": "aging",
25
+ "aggrandisement": "aggrandizement",
26
+ "agonise": "agonize",
27
+ "agonised": "agonized",
28
+ "agonises": "agonizes",
29
+ "agonising": "agonizing",
30
+ "agonisingly": "agonizingly",
31
+ "almanack": "almanac",
32
+ "almanacks": "almanacs",
33
+ "aluminium": "aluminum",
34
+ "amortisable": "amortizable",
35
+ "amortisation": "amortization",
36
+ "amortisations": "amortizations",
37
+ "amortise": "amortize",
38
+ "amortised": "amortized",
39
+ "amortises": "amortizes",
40
+ "amortising": "amortizing",
41
+ "amphitheatre": "amphitheater",
42
+ "amphitheatres": "amphitheaters",
43
+ "anaemia": "anemia",
44
+ "anaemic": "anemic",
45
+ "anaesthesia": "anesthesia",
46
+ "anaesthetic": "anesthetic",
47
+ "anaesthetics": "anesthetics",
48
+ "anaesthetise": "anesthetize",
49
+ "anaesthetised": "anesthetized",
50
+ "anaesthetises": "anesthetizes",
51
+ "anaesthetising": "anesthetizing",
52
+ "anaesthetist": "anesthetist",
53
+ "anaesthetists": "anesthetists",
54
+ "anaesthetize": "anesthetize",
55
+ "anaesthetized": "anesthetized",
56
+ "anaesthetizes": "anesthetizes",
57
+ "anaesthetizing": "anesthetizing",
58
+ "analogue": "analog",
59
+ "analogues": "analogs",
60
+ "analyse": "analyze",
61
+ "analysed": "analyzed",
62
+ "analyses": "analyzes",
63
+ "analysing": "analyzing",
64
+ "anglicise": "anglicize",
65
+ "anglicised": "anglicized",
66
+ "anglicises": "anglicizes",
67
+ "anglicising": "anglicizing",
68
+ "annualised": "annualized",
69
+ "antagonise": "antagonize",
70
+ "antagonised": "antagonized",
71
+ "antagonises": "antagonizes",
72
+ "antagonising": "antagonizing",
73
+ "apologise": "apologize",
74
+ "apologised": "apologized",
75
+ "apologises": "apologizes",
76
+ "apologising": "apologizing",
77
+ "appal": "appall",
78
+ "appals": "appalls",
79
+ "appetiser": "appetizer",
80
+ "appetisers": "appetizers",
81
+ "appetising": "appetizing",
82
+ "appetisingly": "appetizingly",
83
+ "arbour": "arbor",
84
+ "arbours": "arbors",
85
+ "archaeologically": "archeologically",
86
+ "archaeologist": "archeologist",
87
+ "archaeologists": "archeologists",
88
+ "archaeology": "archeology</span>",
89
+ "archeological": "archaeological",
90
+ "ardour": "ardor",
91
+ "armour": "armor",
92
+ "armoured": "armored",
93
+ "armourer": "armorer",
94
+ "armourers": "armorers",
95
+ "armouries": "armories",
96
+ "armoury": "armory",
97
+ "artefact": "artifact",
98
+ "artefacts": "artifacts",
99
+ "authorise": "authorize",
100
+ "authorised": "authorized",
101
+ "authorises": "authorizes",
102
+ "authorising": "authorizing",
103
+ "axe": "ax",
104
+ "backpedalled": "backpedaled",
105
+ "backpedalling": "backpedaling",
106
+ "bannister": "banister",
107
+ "bannisters": "banisters",
108
+ "baptise": "baptize",
109
+ "baptised": "baptized",
110
+ "baptises": "baptizes",
111
+ "baptising": "baptizing",
112
+ "bastardise": "bastardize",
113
+ "bastardised": "bastardized",
114
+ "bastardises": "bastardizes",
115
+ "bastardising": "bastardizing",
116
+ "battleax": "battleaxe",
117
+ "baulk": "balk",
118
+ "baulked": "balked",
119
+ "baulking": "balking",
120
+ "baulks": "balks",
121
+ "bedevilled": "bedeviled",
122
+ "bedevilling": "bedeviling",
123
+ "behaviour": "behavior",
124
+ "behavioural": "behavioral",
125
+ "behaviourism": "behaviorism",
126
+ "behaviourist": "behaviorist",
127
+ "behaviourists": "behaviorists",
128
+ "behaviours": "behaviors",
129
+ "behove": "behoove",
130
+ "behoved": "behooved",
131
+ "behoves": "behooves",
132
+ "bejewelled": "bejeweled",
133
+ "belabour": "belabor",
134
+ "belaboured": "belabored",
135
+ "belabouring": "belaboring",
136
+ "belabours": "belabors",
137
+ "bevelled": "beveled",
138
+ "bevvies": "bevies",
139
+ "bevvy": "bevy",
140
+ "biassed": "biased",
141
+ "biassing": "biasing",
142
+ "bingeing": "binging",
143
+ "bougainvillaea": "bougainvillea",
144
+ "bougainvillaeas": "bougainvilleas",
145
+ "bowdlerise": "bowdlerize",
146
+ "bowdlerised": "bowdlerized",
147
+ "bowdlerises": "bowdlerizes",
148
+ "bowdlerising": "bowdlerizing",
149
+ "breathalyse": "breathalyze",
150
+ "breathalysed": "breathalyzed",
151
+ "breathalyser": "breathalyzer",
152
+ "breathalysers": "breathalyzers",
153
+ "breathalyses": "breathalyzes",
154
+ "breathalysing": "breathalyzing",
155
+ "brutalise": "brutalize",
156
+ "brutalised": "brutalized",
157
+ "brutalises": "brutalizes",
158
+ "brutalising": "brutalizing",
159
+ "busses": "buses",
160
+ "bussing": "busing",
161
+ "caesarean": "cesarean",
162
+ "caesareans": "cesareans",
163
+ "calibre": "caliber",
164
+ "calibres": "calibers",
165
+ "calliper": "caliper",
166
+ "callipers": "calipers",
167
+ "callisthenics": "calisthenics",
168
+ "canalise": "canalize",
169
+ "canalised": "canalized",
170
+ "canalises": "canalizes",
171
+ "canalising": "canalizing",
172
+ "cancelation": "cancellation",
173
+ "cancelations": "cancellations",
174
+ "cancelled": "canceled",
175
+ "cancelling": "canceling",
176
+ "candour": "candor",
177
+ "cannibalise": "cannibalize",
178
+ "cannibalised": "cannibalized",
179
+ "cannibalises": "cannibalizes",
180
+ "cannibalising": "cannibalizing",
181
+ "canonise": "canonize",
182
+ "canonised": "canonized",
183
+ "canonises": "canonizes",
184
+ "canonising": "canonizing",
185
+ "capitalise": "capitalize",
186
+ "capitalised": "capitalized",
187
+ "capitalises": "capitalizes",
188
+ "capitalising": "capitalizing",
189
+ "caramelise": "caramelize",
190
+ "caramelised": "caramelized",
191
+ "caramelises": "caramelizes",
192
+ "caramelising": "caramelizing",
193
+ "carbonise": "carbonize",
194
+ "carbonised": "carbonized",
195
+ "carbonises": "carbonizes",
196
+ "carbonising": "carbonizing",
197
+ "carolled": "caroled",
198
+ "carolling": "caroling",
199
+ "catalogue": "catalog",
200
+ "catalogued": "cataloged",
201
+ "catalogues": "catalogs",
202
+ "cataloguing": "cataloging",
203
+ "catalyse": "catalyze",
204
+ "catalysed": "catalyzed",
205
+ "catalyses": "catalyzes",
206
+ "catalysing": "catalyzing",
207
+ "categorise": "categorize",
208
+ "categorised": "categorized",
209
+ "categorises": "categorizes",
210
+ "categorising": "categorizing",
211
+ "cauterise": "cauterize",
212
+ "cauterised": "cauterized",
213
+ "cauterises": "cauterizes",
214
+ "cauterising": "cauterizing",
215
+ "cavilled": "caviled",
216
+ "cavilling": "caviling",
217
+ "centigramme": "centigram",
218
+ "centigrammes": "centigrams",
219
+ "centilitre": "centiliter",
220
+ "centilitres": "centiliters",
221
+ "centimetre": "centimeter",
222
+ "centimetres": "centimeters",
223
+ "centralise": "centralize",
224
+ "centralised": "centralized",
225
+ "centralises": "centralizes",
226
+ "centralising": "centralizing",
227
+ "centre": "center",
228
+ "centred": "centered",
229
+ "centrefold": "centerfold",
230
+ "centrefolds": "centerfolds",
231
+ "centrepiece": "centerpiece",
232
+ "centrepieces": "centerpieces",
233
+ "centres": "centers",
234
+ "channelled": "channeled",
235
+ "channelling": "channeling",
236
+ "characterise": "characterize",
237
+ "characterised": "characterized",
238
+ "characterises": "characterizes",
239
+ "characterising": "characterizing",
240
+ "cheque": "check",
241
+ "chequebook": "checkbook",
242
+ "chequebooks": "checkbooks",
243
+ "chequered": "checkered",
244
+ "cheques": "checks",
245
+ "chilli": "chili",
246
+ "chimaera": "chimera",
247
+ "chimaeras": "chimeras",
248
+ "chiselled": "chiseled",
249
+ "chiselling": "chiseling",
250
+ "circularise": "circularize",
251
+ "circularised": "circularized",
252
+ "circularises": "circularizes",
253
+ "circularising": "circularizing",
254
+ "civilise": "civilize",
255
+ "civilised": "civilized",
256
+ "civilises": "civilizes",
257
+ "civilising": "civilizing",
258
+ "clamour": "clamor",
259
+ "clamoured": "clamored",
260
+ "clamouring": "clamoring",
261
+ "clamours": "clamors",
262
+ "clangour": "clangor",
263
+ "clarinettist": "clarinetist",
264
+ "clarinettists": "clarinetists",
265
+ "collectivise": "collectivize",
266
+ "collectivised": "collectivized",
267
+ "collectivises": "collectivizes",
268
+ "collectivising": "collectivizing",
269
+ "colonisation": "colonization",
270
+ "colonise": "colonize",
271
+ "colonised": "colonized",
272
+ "coloniser": "colonizer",
273
+ "colonisers": "colonizers",
274
+ "colonises": "colonizes",
275
+ "colonising": "colonizing",
276
+ "colour": "color",
277
+ "colourant": "colorant",
278
+ "colourants": "colorants",
279
+ "coloured": "colored",
280
+ "coloureds": "coloreds",
281
+ "colourful": "colorful",
282
+ "colourfully": "colorfully",
283
+ "colouring": "coloring",
284
+ "colourize": "colorize",
285
+ "colourized": "colorized",
286
+ "colourizes": "colorizes",
287
+ "colourizing": "colorizing",
288
+ "colourless": "colorless",
289
+ "colours": "colors",
290
+ "commercialise": "commercialize",
291
+ "commercialised": "commercialized",
292
+ "commercialises": "commercializes",
293
+ "commercialising": "commercializing",
294
+ "compartmentalise": "compartmentalize",
295
+ "compartmentalised": "compartmentalized",
296
+ "compartmentalises": "compartmentalizes",
297
+ "compartmentalising": "compartmentalizing",
298
+ "computerise": "computerize",
299
+ "computerised": "computerized",
300
+ "computerises": "computerizes",
301
+ "computerising": "computerizing",
302
+ "conceptualise": "conceptualize",
303
+ "conceptualised": "conceptualized",
304
+ "conceptualises": "conceptualizes",
305
+ "conceptualising": "conceptualizing",
306
+ "connexion": "connection",
307
+ "connexions": "connections",
308
+ "contextualise": "contextualize",
309
+ "contextualised": "contextualized",
310
+ "contextualises": "contextualizes",
311
+ "contextualising": "contextualizing",
312
+ "cosier": "cozier",
313
+ "cosies": "cozies",
314
+ "cosiest": "coziest",
315
+ "cosily": "cozily",
316
+ "cosiness": "coziness",
317
+ "cosy": "cozy",
318
+ "councillor": "councilor",
319
+ "councillors": "councilors",
320
+ "counselled": "counseled",
321
+ "counselling": "counseling",
322
+ "counsellor": "counselor",
323
+ "counsellors": "counselors",
324
+ "crenelated": "crenellated",
325
+ "criminalise": "criminalize",
326
+ "criminalised": "criminalized",
327
+ "criminalises": "criminalizes",
328
+ "criminalising": "criminalizing",
329
+ "criticise": "criticize",
330
+ "criticised": "criticized",
331
+ "criticises": "criticizes",
332
+ "criticising": "criticizing",
333
+ "crueller": "crueler",
334
+ "cruellest": "cruelest",
335
+ "crystallisation": "crystallization",
336
+ "crystallise": "crystallize",
337
+ "crystallised": "crystallized",
338
+ "crystallises": "crystallizes",
339
+ "crystallising": "crystallizing",
340
+ "cudgelled": "cudgeled",
341
+ "cudgelling": "cudgeling",
342
+ "customise": "customize",
343
+ "customised": "customized",
344
+ "customises": "customizes",
345
+ "customising": "customizing",
346
+ "cypher": "cipher",
347
+ "cyphers": "ciphers",
348
+ "decentralisation": "decentralization",
349
+ "decentralise": "decentralize",
350
+ "decentralised": "decentralized",
351
+ "decentralises": "decentralizes",
352
+ "decentralising": "decentralizing",
353
+ "decriminalisation": "decriminalization",
354
+ "decriminalise": "decriminalize",
355
+ "decriminalised": "decriminalized",
356
+ "decriminalises": "decriminalizes",
357
+ "decriminalising": "decriminalizing",
358
+ "defence": "defense",
359
+ "defenceless": "defenseless",
360
+ "defences": "defenses",
361
+ "dehumanisation": "dehumanization",
362
+ "dehumanise": "dehumanize",
363
+ "dehumanised": "dehumanized",
364
+ "dehumanises": "dehumanizes",
365
+ "dehumanising": "dehumanizing",
366
+ "demeanour": "demeanor",
367
+ "demilitarisation": "demilitarization",
368
+ "demilitarise": "demilitarize",
369
+ "demilitarised": "demilitarized",
370
+ "demilitarises": "demilitarizes",
371
+ "demilitarising": "demilitarizing",
372
+ "demobilisation": "demobilization",
373
+ "demobilise": "demobilize",
374
+ "demobilised": "demobilized",
375
+ "demobilises": "demobilizes",
376
+ "demobilising": "demobilizing",
377
+ "democratisation": "democratization",
378
+ "democratise": "democratize",
379
+ "democratised": "democratized",
380
+ "democratises": "democratizes",
381
+ "democratising": "democratizing",
382
+ "demonise": "demonize",
383
+ "demonised": "demonized",
384
+ "demonises": "demonizes",
385
+ "demonising": "demonizing",
386
+ "demoralisation": "demoralization",
387
+ "demoralise": "demoralize",
388
+ "demoralised": "demoralized",
389
+ "demoralises": "demoralizes",
390
+ "demoralising": "demoralizing",
391
+ "denationalisation": "denationalization",
392
+ "denationalise": "denationalize",
393
+ "denationalised": "denationalized",
394
+ "denationalises": "denationalizes",
395
+ "denationalising": "denationalizing",
396
+ "deodorise": "deodorize",
397
+ "deodorised": "deodorized",
398
+ "deodorises": "deodorizes",
399
+ "deodorising": "deodorizing",
400
+ "depersonalise": "depersonalize",
401
+ "depersonalised": "depersonalized",
402
+ "depersonalises": "depersonalizes",
403
+ "depersonalising": "depersonalizing",
404
+ "deputise": "deputize",
405
+ "deputised": "deputized",
406
+ "deputises": "deputizes",
407
+ "deputising": "deputizing",
408
+ "desensitisation": "desensitization",
409
+ "desensitise": "desensitize",
410
+ "desensitised": "desensitized",
411
+ "desensitises": "desensitizes",
412
+ "desensitising": "desensitizing",
413
+ "destabilisation": "destabilization",
414
+ "destabilise": "destabilize",
415
+ "destabilised": "destabilized",
416
+ "destabilises": "destabilizes",
417
+ "destabilising": "destabilizing",
418
+ "dialled": "dialed",
419
+ "dialling": "dialing",
420
+ "dialogue": "dialog",
421
+ "dialogues": "dialogs",
422
+ "diarrhoea": "diarrhea",
423
+ "digitise": "digitize",
424
+ "digitised": "digitized",
425
+ "digitises": "digitizes",
426
+ "digitising": "digitizing",
427
+ "disc": "disk",
428
+ "discolour": "discolor",
429
+ "discoloured": "discolored",
430
+ "discolouring": "discoloring",
431
+ "discolours": "discolors",
432
+ "discs": "disks",
433
+ "disembowelled": "disemboweled",
434
+ "disembowelling": "disemboweling",
435
+ "disfavour": "disfavor",
436
+ "dishevelled": "disheveled",
437
+ "dishonour": "dishonor",
438
+ "dishonourable": "dishonorable",
439
+ "dishonourably": "dishonorably",
440
+ "dishonoured": "dishonored",
441
+ "dishonouring": "dishonoring",
442
+ "dishonours": "dishonors",
443
+ "disorganisation": "disorganization",
444
+ "disorganised": "disorganized",
445
+ "distil": "distill",
446
+ "distils": "distills",
447
+ "dramatisation": "dramatization",
448
+ "dramatisations": "dramatizations",
449
+ "dramatise": "dramatize",
450
+ "dramatised": "dramatized",
451
+ "dramatises": "dramatizes",
452
+ "dramatising": "dramatizing",
453
+ "draught": "draft",
454
+ "draughtboard": "draftboard",
455
+ "draughtboards": "draftboards",
456
+ "draughtier": "draftier",
457
+ "draughtiest": "draftiest",
458
+ "draughts": "drafts",
459
+ "draughtsman": "draftsman",
460
+ "draughtsmanship": "draftsmanship",
461
+ "draughtsmen": "draftsmen",
462
+ "draughtswoman": "draftswoman",
463
+ "draughtswomen": "draftswomen",
464
+ "draughty": "drafty",
465
+ "drivelled": "driveled",
466
+ "drivelling": "driveling",
467
+ "duelled": "dueled",
468
+ "duelling": "dueling",
469
+ "economise": "economize",
470
+ "economised": "economized",
471
+ "economises": "economizes",
472
+ "economising": "economizing",
473
+ "editorialise": "editorialize",
474
+ "editorialised": "editorialized",
475
+ "editorialises": "editorializes",
476
+ "editorialising": "editorializing",
477
+ "edoema": "edema",
478
+ "empathise": "empathize",
479
+ "empathised": "empathized",
480
+ "empathises": "empathizes",
481
+ "empathising": "empathizing",
482
+ "emphasise": "emphasize",
483
+ "emphasised": "emphasized",
484
+ "emphasises": "emphasizes",
485
+ "emphasising": "emphasizing",
486
+ "enamelled": "enameled",
487
+ "enamelling": "enameling",
488
+ "enamoured": "enamored",
489
+ "encyclopaedia": "encyclopedia",
490
+ "encyclopaedias": "encyclopedias",
491
+ "encyclopaedic": "encyclopedic",
492
+ "endeavour": "endeavor",
493
+ "endeavoured": "endeavored",
494
+ "endeavouring": "endeavoring",
495
+ "endeavours": "endeavors",
496
+ "energise": "energize",
497
+ "energised": "energized",
498
+ "energises": "energizes",
499
+ "energising": "energizing",
500
+ "enrol": "enroll",
501
+ "enrols": "enrolls",
502
+ "enthral": "enthrall",
503
+ "enthrals": "enthralls",
504
+ "epaulette": "epaulet",
505
+ "epaulettes": "epaulets",
506
+ "epicentre": "epicenter",
507
+ "epicentres": "epicenters",
508
+ "epilogue": "epilog",
509
+ "epilogues": "epilogs",
510
+ "epitomise": "epitomize",
511
+ "epitomised": "epitomized",
512
+ "epitomises": "epitomizes",
513
+ "epitomising": "epitomizing",
514
+ "equalisation": "equalization",
515
+ "equalise": "equalize",
516
+ "equalised": "equalized",
517
+ "equaliser": "equalizer",
518
+ "equalisers": "equalizers",
519
+ "equalises": "equalizes",
520
+ "equalising": "equalizing",
521
+ "eulogise": "eulogize",
522
+ "eulogised": "eulogized",
523
+ "eulogises": "eulogizes",
524
+ "eulogising": "eulogizing",
525
+ "evangelise": "evangelize",
526
+ "evangelised": "evangelized",
527
+ "evangelises": "evangelizes",
528
+ "evangelising": "evangelizing",
529
+ "exorcise": "exorcize",
530
+ "exorcised": "exorcized",
531
+ "exorcises": "exorcizes",
532
+ "exorcising": "exorcizing",
533
+ "extemporisation": "extemporization",
534
+ "extemporise": "extemporize",
535
+ "extemporised": "extemporized",
536
+ "extemporises": "extemporizes",
537
+ "extemporising": "extemporizing",
538
+ "externalisation": "externalization",
539
+ "externalisations": "externalizations",
540
+ "externalise": "externalize",
541
+ "externalised": "externalized",
542
+ "externalises": "externalizes",
543
+ "externalising": "externalizing",
544
+ "factorise": "factorize",
545
+ "factorised": "factorized",
546
+ "factorises": "factorizes",
547
+ "factorising": "factorizing",
548
+ "faecal": "fecal",
549
+ "faeces": "feces",
550
+ "familiarisation": "familiarization",
551
+ "familiarise": "familiarize",
552
+ "familiarised": "familiarized",
553
+ "familiarises": "familiarizes",
554
+ "familiarising": "familiarizing",
555
+ "fantasise": "fantasize",
556
+ "fantasised": "fantasized",
557
+ "fantasises": "fantasizes",
558
+ "fantasising": "fantasizing",
559
+ "favour": "favor",
560
+ "favourable": "favorable",
561
+ "favourably": "favorably",
562
+ "favoured": "favored",
563
+ "favouring": "favoring",
564
+ "favourite": "favorite",
565
+ "favourites": "favorites",
566
+ "favouritism": "favoritism",
567
+ "favours": "favors",
568
+ "feminise": "feminize",
569
+ "feminised": "feminized",
570
+ "feminises": "feminizes",
571
+ "feminising": "feminizing",
572
+ "fertilisation": "fertilization",
573
+ "fertilise": "fertilize",
574
+ "fertilised": "fertilized",
575
+ "fertiliser": "fertilizer",
576
+ "fertilisers": "fertilizers",
577
+ "fertilises": "fertilizes",
578
+ "fertilising": "fertilizing",
579
+ "fervour": "fervor",
580
+ "fibre": "fiber",
581
+ "fibreglass": "fiberglass",
582
+ "fibres": "fibers",
583
+ "fictionalisation": "fictionalization",
584
+ "fictionalisations": "fictionalizations",
585
+ "fictionalise": "fictionalize",
586
+ "fictionalised": "fictionalized",
587
+ "fictionalises": "fictionalizes",
588
+ "fictionalising": "fictionalizing",
589
+ "fillet": "filet",
590
+ "filleted": "fileted",
591
+ "filleting": "fileting",
592
+ "fillets": "filets",
593
+ "finalisation": "finalization",
594
+ "finalise": "finalize",
595
+ "finalised": "finalized",
596
+ "finalises": "finalizes",
597
+ "finalising": "finalizing",
598
+ "flautist": "flutist",
599
+ "flautists": "flutists",
600
+ "flavour": "flavor",
601
+ "flavoured": "flavored",
602
+ "flavouring": "flavoring",
603
+ "flavourings": "flavorings",
604
+ "flavourless": "flavorless",
605
+ "flavours": "flavors",
606
+ "flavoursome": "flavorsome",
607
+ "flyer / flier": "flier / flyer",
608
+ "foetal": "fetal",
609
+ "foetid": "fetid",
610
+ "foetus": "fetus",
611
+ "foetuses": "fetuses",
612
+ "formalisation": "formalization",
613
+ "formalise": "formalize",
614
+ "formalised": "formalized",
615
+ "formalises": "formalizes",
616
+ "formalising": "formalizing",
617
+ "fossilisation": "fossilization",
618
+ "fossilise": "fossilize",
619
+ "fossilised": "fossilized",
620
+ "fossilises": "fossilizes",
621
+ "fossilising": "fossilizing",
622
+ "fraternisation": "fraternization",
623
+ "fraternise": "fraternize",
624
+ "fraternised": "fraternized",
625
+ "fraternises": "fraternizes",
626
+ "fraternising": "fraternizing",
627
+ "fulfil": "fulfill",
628
+ "fulfilment": "fulfillment",
629
+ "fulfils": "fulfills",
630
+ "funnelled": "funneled",
631
+ "funnelling": "funneling",
632
+ "gage": "gauge",
633
+ "gaged": "gauged",
634
+ "gages": "gauges",
635
+ "gaging": "gauging",
636
+ "galvanise": "galvanize",
637
+ "galvanised": "galvanized",
638
+ "galvanises": "galvanizes",
639
+ "galvanising": "galvanizing",
640
+ "gambolled": "gamboled",
641
+ "gambolling": "gamboling",
642
+ "gaol": "jail",
643
+ "gaolbird": "jailbird",
644
+ "gaolbirds": "jailbirds",
645
+ "gaolbreak": "jailbreak",
646
+ "gaolbreaks": "jailbreaks",
647
+ "gaoled": "jailed",
648
+ "gaoler": "jailer",
649
+ "gaolers": "jailers",
650
+ "gaoling": "jailing",
651
+ "gaols": "jails",
652
+ "gasses": "gases",
653
+ "generalisation": "generalization",
654
+ "generalisations": "generalizations",
655
+ "generalise": "generalize",
656
+ "generalised": "generalized",
657
+ "generalises": "generalizes",
658
+ "generalising": "generalizing",
659
+ "ghettoise": "ghettoize",
660
+ "ghettoised": "ghettoized",
661
+ "ghettoises": "ghettoizes",
662
+ "ghettoising": "ghettoizing",
663
+ "gipsies": "gypsies",
664
+ "glamor": "glamour",
665
+ "glamorise": "glamorize",
666
+ "glamorised": "glamorized",
667
+ "glamorises": "glamorizes",
668
+ "glamorising": "glamorizing",
669
+ "globalisation": "globalization",
670
+ "globalise": "globalize",
671
+ "globalised": "globalized",
672
+ "globalises": "globalizes",
673
+ "globalising": "globalizing",
674
+ "glueing": "gluing",
675
+ "goitre": "goiter",
676
+ "goitres": "goiters",
677
+ "gonorrhoea": "gonorrhea",
678
+ "gramme": "gram",
679
+ "grammes": "grams",
680
+ "gravelled": "graveled",
681
+ "grey": "gray",
682
+ "greyed": "grayed",
683
+ "greying": "graying",
684
+ "greyish": "grayish",
685
+ "greyness": "grayness",
686
+ "greys": "grays",
687
+ "grovelled": "groveled",
688
+ "grovelling": "groveling",
689
+ "groyne": "groin",
690
+ "groynes": "groins",
691
+ "gruelling": "grueling",
692
+ "gruellingly": "gruelingly",
693
+ "gryphon": "griffin",
694
+ "gryphons": "griffins",
695
+ "gynaecological": "gynecological",
696
+ "gynaecologist": "gynecologist",
697
+ "gynaecologists": "gynecologists",
698
+ "gynaecology": "gynecology",
699
+ "haematological": "hematological",
700
+ "haematologist": "hematologist",
701
+ "haematologists": "hematologists",
702
+ "haematology": "hematology",
703
+ "haemoglobin": "hemoglobin",
704
+ "haemophilia": "hemophilia",
705
+ "haemophiliac": "hemophiliac",
706
+ "haemophiliacs": "hemophiliacs",
707
+ "haemorrhage": "hemorrhage",
708
+ "haemorrhaged": "hemorrhaged",
709
+ "haemorrhages": "hemorrhages",
710
+ "haemorrhaging": "hemorrhaging",
711
+ "haemorrhoids": "hemorrhoids",
712
+ "harbour": "harbor",
713
+ "harboured": "harbored",
714
+ "harbouring": "harboring",
715
+ "harbours": "harbors",
716
+ "harmonisation": "harmonization",
717
+ "harmonise": "harmonize",
718
+ "harmonised": "harmonized",
719
+ "harmonises": "harmonizes",
720
+ "harmonising": "harmonizing",
721
+ "homoeopath": "homeopath",
722
+ "homoeopathic": "homeopathic",
723
+ "homoeopaths": "homeopaths",
724
+ "homoeopathy": "homeopathy",
725
+ "homogenise": "homogenize",
726
+ "homogenised": "homogenized",
727
+ "homogenises": "homogenizes",
728
+ "homogenising": "homogenizing",
729
+ "honour": "honor",
730
+ "honourable": "honorable",
731
+ "honourably": "honorably",
732
+ "honoured": "honored",
733
+ "honouring": "honoring",
734
+ "honours": "honors",
735
+ "hospitalisation": "hospitalization",
736
+ "hospitalise": "hospitalize",
737
+ "hospitalised": "hospitalized",
738
+ "hospitalises": "hospitalizes",
739
+ "hospitalising": "hospitalizing",
740
+ "humanise": "humanize",
741
+ "humanised": "humanized",
742
+ "humanises": "humanizes",
743
+ "humanising": "humanizing",
744
+ "humour": "humor",
745
+ "humoured": "humored",
746
+ "humouring": "humoring",
747
+ "humourless": "humorless",
748
+ "humours": "humors",
749
+ "hybridise": "hybridize",
750
+ "hybridised": "hybridized",
751
+ "hybridises": "hybridizes",
752
+ "hybridising": "hybridizing",
753
+ "hypnotise": "hypnotize",
754
+ "hypnotised": "hypnotized",
755
+ "hypnotises": "hypnotizes",
756
+ "hypnotising": "hypnotizing",
757
+ "hypothesise": "hypothesize",
758
+ "hypothesised": "hypothesized",
759
+ "hypothesises": "hypothesizes",
760
+ "hypothesising": "hypothesizing",
761
+ "idealisation": "idealization",
762
+ "idealise": "idealize",
763
+ "idealised": "idealized",
764
+ "idealises": "idealizes",
765
+ "idealising": "idealizing",
766
+ "idolise": "idolize",
767
+ "idolised": "idolized",
768
+ "idolises": "idolizes",
769
+ "idolising": "idolizing",
770
+ "immobilisation": "immobilization",
771
+ "immobilise": "immobilize",
772
+ "immobilised": "immobilized",
773
+ "immobiliser": "immobilizer",
774
+ "immobilisers": "immobilizers",
775
+ "immobilises": "immobilizes",
776
+ "immobilising": "immobilizing",
777
+ "immortalise": "immortalize",
778
+ "immortalised": "immortalized",
779
+ "immortalises": "immortalizes",
780
+ "immortalising": "immortalizing",
781
+ "immunisation": "immunization",
782
+ "immunise": "immunize",
783
+ "immunised": "immunized",
784
+ "immunises": "immunizes",
785
+ "immunising": "immunizing",
786
+ "impanelled": "impaneled",
787
+ "impanelling": "impaneling",
788
+ "imperilled": "imperiled",
789
+ "imperilling": "imperiling",
790
+ "individualise": "individualize",
791
+ "individualised": "individualized",
792
+ "individualises": "individualizes",
793
+ "individualising": "individualizing",
794
+ "industrialise": "industrialize",
795
+ "industrialised": "industrialized",
796
+ "industrialises": "industrializes",
797
+ "industrialising": "industrializing",
798
+ "inflexion": "inflection",
799
+ "inflexions": "inflections",
800
+ "initialise": "initialize",
801
+ "initialised": "initialized",
802
+ "initialises": "initializes",
803
+ "initialising": "initializing",
804
+ "initialled": "initialed",
805
+ "initialling": "initialing",
806
+ "instal": "install",
807
+ "instalment": "installment",
808
+ "instalments": "installments",
809
+ "instals": "installs",
810
+ "instil": "instill",
811
+ "instils": "instills",
812
+ "institutionalisation": "institutionalization",
813
+ "institutionalise": "institutionalize",
814
+ "institutionalised": "institutionalized",
815
+ "institutionalises": "institutionalizes",
816
+ "institutionalising": "institutionalizing",
817
+ "intellectualise": "intellectualize",
818
+ "intellectualised": "intellectualized",
819
+ "intellectualises": "intellectualizes",
820
+ "intellectualising": "intellectualizing",
821
+ "internalisation": "internalization",
822
+ "internalise": "internalize",
823
+ "internalised": "internalized",
824
+ "internalises": "internalizes",
825
+ "internalising": "internalizing",
826
+ "internationalisation": "internationalization",
827
+ "internationalise": "internationalize",
828
+ "internationalised": "internationalized",
829
+ "internationalises": "internationalizes",
830
+ "internationalising": "internationalizing",
831
+ "ionisation": "ionization",
832
+ "ionise": "ionize",
833
+ "ionised": "ionized",
834
+ "ioniser": "ionizer",
835
+ "ionisers": "ionizers",
836
+ "ionises": "ionizes",
837
+ "ionising": "ionizing",
838
+ "italicise": "italicize",
839
+ "italicised": "italicized",
840
+ "italicises": "italicizes",
841
+ "italicising": "italicizing",
842
+ "itemise": "itemize",
843
+ "itemised": "itemized",
844
+ "itemises": "itemizes",
845
+ "itemising": "itemizing",
846
+ "jeopardise": "jeopardize",
847
+ "jeopardised": "jeopardized",
848
+ "jeopardises": "jeopardizes",
849
+ "jeopardising": "jeopardizing",
850
+ "jewelled": "jeweled",
851
+ "jeweller": "jeweler",
852
+ "jewellers": "jewelers",
853
+ "jewellery": "jewelry",
854
+ "judgement": "judgment",
855
+ "kilogramme": "kilogram",
856
+ "kilogrammes": "kilograms",
857
+ "kilometre": "kilometer",
858
+ "kilometres": "kilometers",
859
+ "labelled": "labeled",
860
+ "labelling": "labeling",
861
+ "labour": "labor",
862
+ "laboured": "labored",
863
+ "labourer": "laborer",
864
+ "labourers": "laborers",
865
+ "labouring": "laboring",
866
+ "labours": "labors",
867
+ "lacklustre": "lackluster",
868
+ "legalisation": "legalization",
869
+ "legalise": "legalize",
870
+ "legalised": "legalized",
871
+ "legalises": "legalizes",
872
+ "legalising": "legalizing",
873
+ "legitimise": "legitimize",
874
+ "legitimised": "legitimized",
875
+ "legitimises": "legitimizes",
876
+ "legitimising": "legitimizing",
877
+ "leukaemia": "leukemia",
878
+ "levelled": "leveled",
879
+ "leveller": "leveler",
880
+ "levellers": "levelers",
881
+ "levelling": "leveling",
882
+ "libelled": "libeled",
883
+ "libelling": "libeling",
884
+ "libellous": "libelous",
885
+ "liberalisation": "liberalization",
886
+ "liberalise": "liberalize",
887
+ "liberalised": "liberalized",
888
+ "liberalises": "liberalizes",
889
+ "liberalising": "liberalizing",
890
+ "licence": "license",
891
+ "licenced": "licensed",
892
+ "licences": "licenses",
893
+ "licencing": "licensing",
894
+ "likeable": "likable",
895
+ "lionisation": "lionization",
896
+ "lionise": "lionize",
897
+ "lionised": "lionized",
898
+ "lionises": "lionizes",
899
+ "lionising": "lionizing",
900
+ "liquidise": "liquidize",
901
+ "liquidised": "liquidized",
902
+ "liquidiser": "liquidizer",
903
+ "liquidisers": "liquidizers",
904
+ "liquidises": "liquidizes",
905
+ "liquidising": "liquidizing",
906
+ "litre": "liter",
907
+ "litres": "liters",
908
+ "localise": "localize",
909
+ "localised": "localized",
910
+ "localises": "localizes",
911
+ "localising": "localizing",
912
+ "louvre": "louver",
913
+ "louvred": "louvered",
914
+ "louvres": "louvers",
915
+ "lustre": "luster",
916
+ "magnetise": "magnetize",
917
+ "magnetised": "magnetized",
918
+ "magnetises": "magnetizes",
919
+ "magnetising": "magnetizing",
920
+ "manoeuvrability": "maneuverability",
921
+ "manoeuvrable": "maneuverable",
922
+ "manoeuvre": "maneuver",
923
+ "manoeuvred": "maneuvered",
924
+ "manoeuvres": "maneuvers",
925
+ "manoeuvring": "maneuvering",
926
+ "manoeuvrings": "maneuverings",
927
+ "marginalisation": "marginalization",
928
+ "marginalise": "marginalize",
929
+ "marginalised": "marginalized",
930
+ "marginalises": "marginalizes",
931
+ "marginalising": "marginalizing",
932
+ "marshalled": "marshaled",
933
+ "marshalling": "marshaling",
934
+ "marvelled": "marveled",
935
+ "marvelling": "marveling",
936
+ "marvellous": "marvelous",
937
+ "marvellously": "marvelously",
938
+ "materialisation": "materialization",
939
+ "materialise": "materialize",
940
+ "materialised": "materialized",
941
+ "materialises": "materializes",
942
+ "materialising": "materializing",
943
+ "maximisation": "maximization",
944
+ "maximise": "maximize",
945
+ "maximised": "maximized",
946
+ "maximises": "maximizes",
947
+ "maximising": "maximizing",
948
+ "meagre": "meager",
949
+ "mechanisation": "mechanization",
950
+ "mechanise": "mechanize",
951
+ "mechanised": "mechanized",
952
+ "mechanises": "mechanizes",
953
+ "mechanising": "mechanizing",
954
+ "mediaeval": "medieval",
955
+ "memorialise": "memorialize",
956
+ "memorialised": "memorialized",
957
+ "memorialises": "memorializes",
958
+ "memorialising": "memorializing",
959
+ "memorise": "memorize",
960
+ "memorised": "memorized",
961
+ "memorises": "memorizes",
962
+ "memorising": "memorizing",
963
+ "mesmerise": "mesmerize",
964
+ "mesmerised": "mesmerized",
965
+ "mesmerises": "mesmerizes",
966
+ "mesmerising": "mesmerizing",
967
+ "metabolise": "metabolize",
968
+ "metabolised": "metabolized",
969
+ "metabolises": "metabolizes",
970
+ "metabolising": "metabolizing",
971
+ "metre": "meter",
972
+ "metres": "meters",
973
+ "mhm": "hmm",
974
+ "micrometre": "micrometer",
975
+ "micrometres": "micrometers",
976
+ "militarise": "militarize",
977
+ "militarised": "militarized",
978
+ "militarises": "militarizes",
979
+ "militarising": "militarizing",
980
+ "milligramme": "milligram",
981
+ "milligrammes": "milligrams",
982
+ "millilitre": "milliliter",
983
+ "millilitres": "milliliters",
984
+ "millimetre": "millimeter",
985
+ "millimetres": "millimeters",
986
+ "miniaturisation": "miniaturization",
987
+ "miniaturise": "miniaturize",
988
+ "miniaturised": "miniaturized",
989
+ "miniaturises": "miniaturizes",
990
+ "miniaturising": "miniaturizing",
991
+ "minibusses": "minibuses",
992
+ "minimise": "minimize",
993
+ "minimised": "minimized",
994
+ "minimises": "minimizes",
995
+ "minimising": "minimizing",
996
+ "misbehaviour": "misbehavior",
997
+ "misdemeanour": "misdemeanor",
998
+ "misdemeanours": "misdemeanors",
999
+ "misspelt": "misspelled",
1000
+ "mitre": "miter",
1001
+ "mitres": "miters",
1002
+ "mm": "hmm",
1003
+ "mmm": "hmm",
1004
+ "mobilisation": "mobilization",
1005
+ "mobilise": "mobilize",
1006
+ "mobilised": "mobilized",
1007
+ "mobilises": "mobilizes",
1008
+ "mobilising": "mobilizing",
1009
+ "modelled": "modeled",
1010
+ "modeller": "modeler",
1011
+ "modellers": "modelers",
1012
+ "modelling": "modeling",
1013
+ "modernise": "modernize",
1014
+ "modernised": "modernized",
1015
+ "modernises": "modernizes",
1016
+ "modernising": "modernizing",
1017
+ "moisturise": "moisturize",
1018
+ "moisturised": "moisturized",
1019
+ "moisturiser": "moisturizer",
1020
+ "moisturisers": "moisturizers",
1021
+ "moisturises": "moisturizes",
1022
+ "moisturising": "moisturizing",
1023
+ "monologue": "monolog",
1024
+ "monologues": "monologs",
1025
+ "monopolisation": "monopolization",
1026
+ "monopolise": "monopolize",
1027
+ "monopolised": "monopolized",
1028
+ "monopolises": "monopolizes",
1029
+ "monopolising": "monopolizing",
1030
+ "moralise": "moralize",
1031
+ "moralised": "moralized",
1032
+ "moralises": "moralizes",
1033
+ "moralising": "moralizing",
1034
+ "motorised": "motorized",
1035
+ "mould": "mold",
1036
+ "moulded": "molded",
1037
+ "moulder": "molder",
1038
+ "mouldered": "moldered",
1039
+ "mouldering": "moldering",
1040
+ "moulders": "molders",
1041
+ "mouldier": "moldier",
1042
+ "mouldiest": "moldiest",
1043
+ "moulding": "molding",
1044
+ "mouldings": "moldings",
1045
+ "moulds": "molds",
1046
+ "mouldy": "moldy",
1047
+ "moult": "molt",
1048
+ "moulted": "molted",
1049
+ "moulting": "molting",
1050
+ "moults": "molts",
1051
+ "moustache": "mustache",
1052
+ "moustached": "mustached",
1053
+ "moustaches": "mustaches",
1054
+ "moustachioed": "mustachioed",
1055
+ "multicoloured": "multicolored",
1056
+ "nationalisation": "nationalization",
1057
+ "nationalisations": "nationalizations",
1058
+ "nationalise": "nationalize",
1059
+ "nationalised": "nationalized",
1060
+ "nationalises": "nationalizes",
1061
+ "nationalising": "nationalizing",
1062
+ "naturalisation": "naturalization",
1063
+ "naturalise": "naturalize",
1064
+ "naturalised": "naturalized",
1065
+ "naturalises": "naturalizes",
1066
+ "naturalising": "naturalizing",
1067
+ "neighbour": "neighbor",
1068
+ "neighbourhood": "neighborhood",
1069
+ "neighbourhoods": "neighborhoods",
1070
+ "neighbouring": "neighboring",
1071
+ "neighbourliness": "neighborliness",
1072
+ "neighbourly": "neighborly",
1073
+ "neighbours": "neighbors",
1074
+ "neutralisation": "neutralization",
1075
+ "neutralise": "neutralize",
1076
+ "neutralised": "neutralized",
1077
+ "neutralises": "neutralizes",
1078
+ "neutralising": "neutralizing",
1079
+ "normalisation": "normalization",
1080
+ "normalise": "normalize",
1081
+ "normalised": "normalized",
1082
+ "normalises": "normalizes",
1083
+ "normalising": "normalizing",
1084
+ "odour": "odor",
1085
+ "odourless": "odorless",
1086
+ "odours": "odors",
1087
+ "oesophagus": "esophagus",
1088
+ "oesophaguses": "esophaguses",
1089
+ "oestrogen": "estrogen",
1090
+ "offence": "offense",
1091
+ "offences": "offenses",
1092
+ "omelette": "omelet",
1093
+ "omelettes": "omelets",
1094
+ "optimise": "optimize",
1095
+ "optimised": "optimized",
1096
+ "optimises": "optimizes",
1097
+ "optimising": "optimizing",
1098
+ "organisation": "organization",
1099
+ "organisational": "organizational",
1100
+ "organisations": "organizations",
1101
+ "organise": "organize",
1102
+ "organised": "organized",
1103
+ "organiser": "organizer",
1104
+ "organisers": "organizers",
1105
+ "organises": "organizes",
1106
+ "organising": "organizing",
1107
+ "orthopaedic": "orthopedic",
1108
+ "orthopaedics": "orthopedics",
1109
+ "ostracise": "ostracize",
1110
+ "ostracised": "ostracized",
1111
+ "ostracises": "ostracizes",
1112
+ "ostracising": "ostracizing",
1113
+ "outmanoeuvre": "outmaneuver",
1114
+ "outmanoeuvred": "outmaneuvered",
1115
+ "outmanoeuvres": "outmaneuvers",
1116
+ "outmanoeuvring": "outmaneuvering",
1117
+ "overemphasise": "overemphasize",
1118
+ "overemphasised": "overemphasized",
1119
+ "overemphasises": "overemphasizes",
1120
+ "overemphasising": "overemphasizing",
1121
+ "oxidisation": "oxidization",
1122
+ "oxidise": "oxidize",
1123
+ "oxidised": "oxidized",
1124
+ "oxidises": "oxidizes",
1125
+ "oxidising": "oxidizing",
1126
+ "paederast": "pederast",
1127
+ "paederasts": "pederasts",
1128
+ "paediatric": "pediatric",
1129
+ "paediatrician": "pediatrician",
1130
+ "paediatricians": "pediatricians",
1131
+ "paediatrics": "pediatrics",
1132
+ "paedophile": "pedophile",
1133
+ "paedophiles": "pedophiles",
1134
+ "paedophilia": "pedophilia",
1135
+ "palaeolithic": "paleolithic",
1136
+ "palaeontologist": "paleontologist",
1137
+ "palaeontologists": "paleontologists",
1138
+ "palaeontology": "paleontology",
1139
+ "panelled": "paneled",
1140
+ "panelling": "paneling",
1141
+ "panellist": "panelist",
1142
+ "panellists": "panelists",
1143
+ "paralyse": "paralyze",
1144
+ "paralysed": "paralyzed",
1145
+ "paralyses": "paralyzes",
1146
+ "paralysing": "paralyzing",
1147
+ "parcelled": "parceled",
1148
+ "parcelling": "parceling",
1149
+ "parlour": "parlor",
1150
+ "parlours": "parlors",
1151
+ "particularise": "particularize",
1152
+ "particularised": "particularized",
1153
+ "particularises": "particularizes",
1154
+ "particularising": "particularizing",
1155
+ "passivisation": "passivization",
1156
+ "passivise": "passivize",
1157
+ "passivised": "passivized",
1158
+ "passivises": "passivizes",
1159
+ "passivising": "passivizing",
1160
+ "pasteurisation": "pasteurization",
1161
+ "pasteurise": "pasteurize",
1162
+ "pasteurised": "pasteurized",
1163
+ "pasteurises": "pasteurizes",
1164
+ "pasteurising": "pasteurizing",
1165
+ "patronise": "patronize",
1166
+ "patronised": "patronized",
1167
+ "patronises": "patronizes",
1168
+ "patronising": "patronizing",
1169
+ "patronisingly": "patronizingly",
1170
+ "pedalled": "pedaled",
1171
+ "pedalling": "pedaling",
1172
+ "pedestrianisation": "pedestrianization",
1173
+ "pedestrianise": "pedestrianize",
1174
+ "pedestrianised": "pedestrianized",
1175
+ "pedestrianises": "pedestrianizes",
1176
+ "pedestrianising": "pedestrianizing",
1177
+ "penalise": "penalize",
1178
+ "penalised": "penalized",
1179
+ "penalises": "penalizes",
1180
+ "penalising": "penalizing",
1181
+ "pencilled": "penciled",
1182
+ "pencilling": "penciling",
1183
+ "personalise": "personalize",
1184
+ "personalised": "personalized",
1185
+ "personalises": "personalizes",
1186
+ "personalising": "personalizing",
1187
+ "pharmacopoeia": "pharmacopeia",
1188
+ "pharmacopoeias": "pharmacopeias",
1189
+ "philosophise": "philosophize",
1190
+ "philosophised": "philosophized",
1191
+ "philosophises": "philosophizes",
1192
+ "philosophising": "philosophizing",
1193
+ "philtre": "filter",
1194
+ "philtres": "filters",
1195
+ "phoney": "phony",
1196
+ "plagiarise": "plagiarize",
1197
+ "plagiarised": "plagiarized",
1198
+ "plagiarises": "plagiarizes",
1199
+ "plagiarising": "plagiarizing",
1200
+ "plough": "plow",
1201
+ "ploughed": "plowed",
1202
+ "ploughing": "plowing",
1203
+ "ploughman": "plowman",
1204
+ "ploughmen": "plowmen",
1205
+ "ploughs": "plows",
1206
+ "ploughshare": "plowshare",
1207
+ "ploughshares": "plowshares",
1208
+ "polarisation": "polarization",
1209
+ "polarise": "polarize",
1210
+ "polarised": "polarized",
1211
+ "polarises": "polarizes",
1212
+ "polarising": "polarizing",
1213
+ "politicisation": "politicization",
1214
+ "politicise": "politicize",
1215
+ "politicised": "politicized",
1216
+ "politicises": "politicizes",
1217
+ "politicising": "politicizing",
1218
+ "popularisation": "popularization",
1219
+ "popularise": "popularize",
1220
+ "popularised": "popularized",
1221
+ "popularises": "popularizes",
1222
+ "popularising": "popularizing",
1223
+ "pouffe": "pouf",
1224
+ "pouffes": "poufs",
1225
+ "practise": "practice",
1226
+ "practised": "practiced",
1227
+ "practises": "practices",
1228
+ "practising": "practicing",
1229
+ "praesidium": "presidium",
1230
+ "praesidiums": "presidiums",
1231
+ "pressurisation": "pressurization",
1232
+ "pressurise": "pressurize",
1233
+ "pressurised": "pressurized",
1234
+ "pressurises": "pressurizes",
1235
+ "pressurising": "pressurizing",
1236
+ "pretence": "pretense",
1237
+ "pretences": "pretenses",
1238
+ "primaeval": "primeval",
1239
+ "prioritisation": "prioritization",
1240
+ "prioritise": "prioritize",
1241
+ "prioritised": "prioritized",
1242
+ "prioritises": "prioritizes",
1243
+ "prioritising": "prioritizing",
1244
+ "privatisation": "privatization",
1245
+ "privatisations": "privatizations",
1246
+ "privatise": "privatize",
1247
+ "privatised": "privatized",
1248
+ "privatises": "privatizes",
1249
+ "privatising": "privatizing",
1250
+ "professionalisation": "professionalization",
1251
+ "professionalise": "professionalize",
1252
+ "professionalised": "professionalized",
1253
+ "professionalises": "professionalizes",
1254
+ "professionalising": "professionalizing",
1255
+ "programme": "program",
1256
+ "programmes": "programs",
1257
+ "prologue": "prolog",
1258
+ "prologues": "prologs",
1259
+ "propagandise": "propagandize",
1260
+ "propagandised": "propagandized",
1261
+ "propagandises": "propagandizes",
1262
+ "propagandising": "propagandizing",
1263
+ "proselytise": "proselytize",
1264
+ "proselytised": "proselytized",
1265
+ "proselytiser": "proselytizer",
1266
+ "proselytisers": "proselytizers",
1267
+ "proselytises": "proselytizes",
1268
+ "proselytising": "proselytizing",
1269
+ "psychoanalyse": "psychoanalyze",
1270
+ "psychoanalysed": "psychoanalyzed",
1271
+ "psychoanalyses": "psychoanalyzes",
1272
+ "psychoanalysing": "psychoanalyzing",
1273
+ "publicise": "publicize",
1274
+ "publicised": "publicized",
1275
+ "publicises": "publicizes",
1276
+ "publicising": "publicizing",
1277
+ "pulverisation": "pulverization",
1278
+ "pulverise": "pulverize",
1279
+ "pulverised": "pulverized",
1280
+ "pulverises": "pulverizes",
1281
+ "pulverising": "pulverizing",
1282
+ "pummelled": "pummel",
1283
+ "pummelling": "pummeled",
1284
+ "pyjama": "pajama",
1285
+ "pyjamas": "pajamas",
1286
+ "pzazz": "pizzazz",
1287
+ "quarrelled": "quarreled",
1288
+ "quarrelling": "quarreling",
1289
+ "radicalise": "radicalize",
1290
+ "radicalised": "radicalized",
1291
+ "radicalises": "radicalizes",
1292
+ "radicalising": "radicalizing",
1293
+ "rancour": "rancor",
1294
+ "randomise": "randomize",
1295
+ "randomised": "randomized",
1296
+ "randomises": "randomizes",
1297
+ "randomising": "randomizing",
1298
+ "rationalisation": "rationalization",
1299
+ "rationalisations": "rationalizations",
1300
+ "rationalise": "rationalize",
1301
+ "rationalised": "rationalized",
1302
+ "rationalises": "rationalizes",
1303
+ "rationalising": "rationalizing",
1304
+ "ravelled": "raveled",
1305
+ "ravelling": "raveling",
1306
+ "realisable": "realizable",
1307
+ "realisation": "realization",
1308
+ "realisations": "realizations",
1309
+ "realise": "realize",
1310
+ "realised": "realized",
1311
+ "realises": "realizes",
1312
+ "realising": "realizing",
1313
+ "recognisable": "recognizable",
1314
+ "recognisably": "recognizably",
1315
+ "recognisance": "recognizance",
1316
+ "recognise": "recognize",
1317
+ "recognised": "recognized",
1318
+ "recognises": "recognizes",
1319
+ "recognising": "recognizing",
1320
+ "reconnoitre": "reconnoiter",
1321
+ "reconnoitred": "reconnoitered",
1322
+ "reconnoitres": "reconnoiters",
1323
+ "reconnoitring": "reconnoitering",
1324
+ "refuelled": "refueled",
1325
+ "refuelling": "refueling",
1326
+ "regularisation": "regularization",
1327
+ "regularise": "regularize",
1328
+ "regularised": "regularized",
1329
+ "regularises": "regularizes",
1330
+ "regularising": "regularizing",
1331
+ "remodelled": "remodeled",
1332
+ "remodelling": "remodeling",
1333
+ "remould": "remold",
1334
+ "remoulded": "remolded",
1335
+ "remoulding": "remolding",
1336
+ "remoulds": "remolds",
1337
+ "reorganisation": "reorganization",
1338
+ "reorganisations": "reorganizations",
1339
+ "reorganise": "reorganize",
1340
+ "reorganised": "reorganized",
1341
+ "reorganises": "reorganizes",
1342
+ "reorganising": "reorganizing",
1343
+ "revelled": "reveled",
1344
+ "reveller": "reveler",
1345
+ "revellers": "revelers",
1346
+ "revelling": "reveling",
1347
+ "revitalise": "revitalize",
1348
+ "revitalised": "revitalized",
1349
+ "revitalises": "revitalizes",
1350
+ "revitalising": "revitalizing",
1351
+ "revolutionise": "revolutionize",
1352
+ "revolutionised": "revolutionized",
1353
+ "revolutionises": "revolutionizes",
1354
+ "revolutionising": "revolutionizing",
1355
+ "rhapsodise": "rhapsodize",
1356
+ "rhapsodised": "rhapsodized",
1357
+ "rhapsodises": "rhapsodizes",
1358
+ "rhapsodising": "rhapsodizing",
1359
+ "rigour": "rigor",
1360
+ "rigours": "rigors",
1361
+ "ritualised": "ritualized",
1362
+ "rivalled": "rivaled",
1363
+ "rivalling": "rivaling",
1364
+ "romanticise": "romanticize",
1365
+ "romanticised": "romanticized",
1366
+ "romanticises": "romanticizes",
1367
+ "romanticising": "romanticizing",
1368
+ "rumour": "rumor",
1369
+ "rumoured": "rumored",
1370
+ "rumours": "rumors",
1371
+ "sabre": "saber",
1372
+ "sabres": "sabers",
1373
+ "saltpetre": "saltpeter",
1374
+ "sanitise": "sanitize",
1375
+ "sanitised": "sanitized",
1376
+ "sanitises": "sanitizes",
1377
+ "sanitising": "sanitizing",
1378
+ "satirise": "satirize",
1379
+ "satirised": "satirized",
1380
+ "satirises": "satirizes",
1381
+ "satirising": "satirizing",
1382
+ "saviour": "savior",
1383
+ "saviours": "saviors",
1384
+ "savour": "savor",
1385
+ "savoured": "savored",
1386
+ "savouries": "savories",
1387
+ "savouring": "savoring",
1388
+ "savours": "savors",
1389
+ "savoury": "savory",
1390
+ "scandalise": "scandalize",
1391
+ "scandalised": "scandalized",
1392
+ "scandalises": "scandalizes",
1393
+ "scandalising": "scandalizing",
1394
+ "sceptic": "skeptic",
1395
+ "sceptical": "skeptical",
1396
+ "sceptically": "skeptically",
1397
+ "scepticism": "skepticism",
1398
+ "sceptics": "skeptics",
1399
+ "sceptre": "scepter",
1400
+ "sceptres": "scepters",
1401
+ "scrutinise": "scrutinize",
1402
+ "scrutinised": "scrutinized",
1403
+ "scrutinises": "scrutinizes",
1404
+ "scrutinising": "scrutinizing",
1405
+ "secularisation": "secularization",
1406
+ "secularise": "secularize",
1407
+ "secularised": "secularized",
1408
+ "secularises": "secularizes",
1409
+ "secularising": "secularizing",
1410
+ "sensationalise": "sensationalize",
1411
+ "sensationalised": "sensationalized",
1412
+ "sensationalises": "sensationalizes",
1413
+ "sensationalising": "sensationalizing",
1414
+ "sensitise": "sensitize",
1415
+ "sensitised": "sensitized",
1416
+ "sensitises": "sensitizes",
1417
+ "sensitising": "sensitizing",
1418
+ "sentimentalise": "sentimentalize",
1419
+ "sentimentalised": "sentimentalized",
1420
+ "sentimentalises": "sentimentalizes",
1421
+ "sentimentalising": "sentimentalizing",
1422
+ "sepulchre": "sepulcher",
1423
+ "sepulchres": "sepulchers",
1424
+ "serialisation": "serialization",
1425
+ "serialisations": "serializations",
1426
+ "serialise": "serialize",
1427
+ "serialised": "serialized",
1428
+ "serialises": "serializes",
1429
+ "serialising": "serializing",
1430
+ "sermonise": "sermonize",
1431
+ "sermonised": "sermonized",
1432
+ "sermonises": "sermonizes",
1433
+ "sermonising": "sermonizing",
1434
+ "sheikh": "sheik",
1435
+ "shovelled": "shoveled",
1436
+ "shovelling": "shoveling",
1437
+ "shrivelled": "shriveled",
1438
+ "shrivelling": "shriveling",
1439
+ "signalise": "signalize",
1440
+ "signalised": "signalized",
1441
+ "signalises": "signalizes",
1442
+ "signalising": "signalizing",
1443
+ "signalled": "signaled",
1444
+ "signalling": "signaling",
1445
+ "smoulder": "smolder",
1446
+ "smouldered": "smoldered",
1447
+ "smouldering": "smoldering",
1448
+ "smoulders": "smolders",
1449
+ "snivelled": "sniveled",
1450
+ "snivelling": "sniveling",
1451
+ "snorkelled": "snorkeled",
1452
+ "snorkelling": "snorkeling",
1453
+ "snowplough": "snowplow",
1454
+ "snowploughs": "snowplow",
1455
+ "socialisation": "socialization",
1456
+ "socialise": "socialize",
1457
+ "socialised": "socialized",
1458
+ "socialises": "socializes",
1459
+ "socialising": "socializing",
1460
+ "sodomise": "sodomize",
1461
+ "sodomised": "sodomized",
1462
+ "sodomises": "sodomizes",
1463
+ "sodomising": "sodomizing",
1464
+ "solemnise": "solemnize",
1465
+ "solemnised": "solemnized",
1466
+ "solemnises": "solemnizes",
1467
+ "solemnising": "solemnizing",
1468
+ "sombre": "somber",
1469
+ "specialisation": "specialization",
1470
+ "specialisations": "specializations",
1471
+ "specialise": "specialize",
1472
+ "specialised": "specialized",
1473
+ "specialises": "specializes",
1474
+ "specialising": "specializing",
1475
+ "spectre": "specter",
1476
+ "spectres": "specters",
1477
+ "spiralled": "spiraled",
1478
+ "spiralling": "spiraling",
1479
+ "splendour": "splendor",
1480
+ "splendours": "splendors",
1481
+ "squirrelled": "squirreled",
1482
+ "squirrelling": "squirreling",
1483
+ "stabilisation": "stabilization",
1484
+ "stabilise": "stabilize",
1485
+ "stabilised": "stabilized",
1486
+ "stabiliser": "stabilizer",
1487
+ "stabilisers": "stabilizers",
1488
+ "stabilises": "stabilizes",
1489
+ "stabilising": "stabilizing",
1490
+ "standardisation": "standardization",
1491
+ "standardise": "standardize",
1492
+ "standardised": "standardized",
1493
+ "standardises": "standardizes",
1494
+ "standardising": "standardizing",
1495
+ "stencilled": "stenciled",
1496
+ "stencilling": "stenciling",
1497
+ "sterilisation": "sterilization",
1498
+ "sterilisations": "sterilizations",
1499
+ "sterilise": "sterilize",
1500
+ "sterilised": "sterilized",
1501
+ "steriliser": "sterilizer",
1502
+ "sterilisers": "sterilizers",
1503
+ "sterilises": "sterilizes",
1504
+ "sterilising": "sterilizing",
1505
+ "stigmatisation": "stigmatization",
1506
+ "stigmatise": "stigmatize",
1507
+ "stigmatised": "stigmatized",
1508
+ "stigmatises": "stigmatizes",
1509
+ "stigmatising": "stigmatizing",
1510
+ "storey": "story",
1511
+ "storeys": "stories",
1512
+ "subsidisation": "subsidization",
1513
+ "subsidise": "subsidize",
1514
+ "subsidised": "subsidized",
1515
+ "subsidiser": "subsidizer",
1516
+ "subsidisers": "subsidizers",
1517
+ "subsidises": "subsidizes",
1518
+ "subsidising": "subsidizing",
1519
+ "succour": "succor",
1520
+ "succoured": "succored",
1521
+ "succouring": "succoring",
1522
+ "succours": "succors",
1523
+ "sulphate": "sulfate",
1524
+ "sulphates": "sulfates",
1525
+ "sulphide": "sulfide",
1526
+ "sulphides": "sulfides",
1527
+ "sulphur": "sulfur",
1528
+ "sulphurous": "sulfurous",
1529
+ "summarise": "summarize",
1530
+ "summarised": "summarized",
1531
+ "summarises": "summarizes",
1532
+ "summarising": "summarizing",
1533
+ "swivelled": "swiveled",
1534
+ "swivelling": "swiveling",
1535
+ "symbolise": "symbolize",
1536
+ "symbolised": "symbolized",
1537
+ "symbolises": "symbolizes",
1538
+ "symbolising": "symbolizing",
1539
+ "sympathise": "sympathize",
1540
+ "sympathised": "sympathized",
1541
+ "sympathiser": "sympathizer",
1542
+ "sympathisers": "sympathizers",
1543
+ "sympathises": "sympathizes",
1544
+ "sympathising": "sympathizing",
1545
+ "synchronisation": "synchronization",
1546
+ "synchronise": "synchronize",
1547
+ "synchronised": "synchronized",
1548
+ "synchronises": "synchronizes",
1549
+ "synchronising": "synchronizing",
1550
+ "synthesise": "synthesize",
1551
+ "synthesised": "synthesized",
1552
+ "synthesiser": "synthesizer",
1553
+ "synthesisers": "synthesizers",
1554
+ "synthesises": "synthesizes",
1555
+ "synthesising": "synthesizing",
1556
+ "syphon": "siphon",
1557
+ "syphoned": "siphoned",
1558
+ "syphoning": "siphoning",
1559
+ "syphons": "siphons",
1560
+ "systematisation": "systematization",
1561
+ "systematise": "systematize",
1562
+ "systematised": "systematized",
1563
+ "systematises": "systematizes",
1564
+ "systematising": "systematizing",
1565
+ "tantalise": "tantalize",
1566
+ "tantalised": "tantalized",
1567
+ "tantalises": "tantalizes",
1568
+ "tantalising": "tantalizing",
1569
+ "tantalisingly": "tantalizingly",
1570
+ "tasselled": "tasseled",
1571
+ "technicolour": "technicolor",
1572
+ "temporise": "temporize",
1573
+ "temporised": "temporized",
1574
+ "temporises": "temporizes",
1575
+ "temporising": "temporizing",
1576
+ "tenderise": "tenderize",
1577
+ "tenderised": "tenderized",
1578
+ "tenderises": "tenderizes",
1579
+ "tenderising": "tenderizing",
1580
+ "terrorise": "terrorize",
1581
+ "terrorised": "terrorized",
1582
+ "terrorises": "terrorizes",
1583
+ "terrorising": "terrorizing",
1584
+ "theatre": "theater",
1585
+ "theatregoer": "theatergoer",
1586
+ "theatregoers": "theatergoers",
1587
+ "theatres": "theaters",
1588
+ "theorise": "theorize",
1589
+ "theorised": "theorized",
1590
+ "theorises": "theorizes",
1591
+ "theorising": "theorizing",
1592
+ "tonne": "ton",
1593
+ "tonnes": "tons",
1594
+ "towelled": "toweled",
1595
+ "towelling": "toweling",
1596
+ "toxaemia": "toxemia",
1597
+ "tranquillise": "tranquilize",
1598
+ "tranquillised": "tranquilized",
1599
+ "tranquilliser": "tranquilizer",
1600
+ "tranquillisers": "tranquilizers",
1601
+ "tranquillises": "tranquilizes",
1602
+ "tranquillising": "tranquilizing",
1603
+ "tranquillity": "tranquility",
1604
+ "tranquillize": "tranquilize",
1605
+ "tranquillized": "tranquilized",
1606
+ "tranquillizer": "tranquilizer",
1607
+ "tranquillizers": "tranquilizers",
1608
+ "tranquillizes": "tranquilizes",
1609
+ "tranquillizing": "tranquilizing",
1610
+ "tranquilly": "tranquility",
1611
+ "transistorised": "transistorized",
1612
+ "traumatise": "traumatize",
1613
+ "traumatised": "traumatized",
1614
+ "traumatises": "traumatizes",
1615
+ "traumatising": "traumatizing",
1616
+ "travelled": "traveled",
1617
+ "traveller": "traveler",
1618
+ "travellers": "travelers",
1619
+ "travelling": "traveling",
1620
+ "travelog": "travelogue",
1621
+ "travelogs": "travelogues",
1622
+ "trialled": "trialed",
1623
+ "trialling": "trialing",
1624
+ "tricolour": "tricolor",
1625
+ "tricolours": "tricolors",
1626
+ "trivialise": "trivialize",
1627
+ "trivialised": "trivialized",
1628
+ "trivialises": "trivializes",
1629
+ "trivialising": "trivializing",
1630
+ "tumour": "tumor",
1631
+ "tumours": "tumors",
1632
+ "tunnelled": "tunneled",
1633
+ "tunnelling": "tunneling",
1634
+ "tyrannise": "tyrannize",
1635
+ "tyrannised": "tyrannized",
1636
+ "tyrannises": "tyrannizes",
1637
+ "tyrannising": "tyrannizing",
1638
+ "tyre": "tire",
1639
+ "tyres": "tires",
1640
+ "unauthorised": "unauthorized",
1641
+ "uncivilised": "uncivilized",
1642
+ "underutilised": "underutilized",
1643
+ "unequalled": "unequaled",
1644
+ "unfavourable": "unfavorable",
1645
+ "unfavourably": "unfavorably",
1646
+ "unionisation": "unionization",
1647
+ "unionise": "unionize",
1648
+ "unionised": "unionized",
1649
+ "unionises": "unionizes",
1650
+ "unionising": "unionizing",
1651
+ "unorganised": "unorganized",
1652
+ "unravelled": "unraveled",
1653
+ "unravelling": "unraveling",
1654
+ "unrecognisable": "unrecognizable",
1655
+ "unrecognised": "unrecognized",
1656
+ "unrivalled": "unrivaled",
1657
+ "unsavoury": "unsavory",
1658
+ "untrammelled": "untrammeled",
1659
+ "urbanisation": "urbanization",
1660
+ "urbanise": "urbanize",
1661
+ "urbanised": "urbanized",
1662
+ "urbanises": "urbanizes",
1663
+ "urbanising": "urbanizing",
1664
+ "utilisable": "utilizable",
1665
+ "utilisation": "utilization",
1666
+ "utilise": "utilize",
1667
+ "utilised": "utilized",
1668
+ "utilises": "utilizes",
1669
+ "utilising": "utilizing",
1670
+ "valour": "valor",
1671
+ "vandalise": "vandalize",
1672
+ "vandalised": "vandalized",
1673
+ "vandalises": "vandalizes",
1674
+ "vandalising": "vandalizing",
1675
+ "vaporisation": "vaporization",
1676
+ "vaporise": "vaporize",
1677
+ "vaporised": "vaporized",
1678
+ "vaporises": "vaporizes",
1679
+ "vaporising": "vaporizing",
1680
+ "vapour": "vapor",
1681
+ "vapours": "vapors",
1682
+ "verbalise": "verbalize",
1683
+ "verbalised": "verbalized",
1684
+ "verbalises": "verbalizes",
1685
+ "verbalising": "verbalizing",
1686
+ "victimisation": "victimization",
1687
+ "victimise": "victimize",
1688
+ "victimised": "victimized",
1689
+ "victimises": "victimizes",
1690
+ "victimising": "victimizing",
1691
+ "videodisc": "videodisk",
1692
+ "videodiscs": "videodisks",
1693
+ "vigour": "vigor",
1694
+ "visualisation": "visualization",
1695
+ "visualisations": "visualizations",
1696
+ "visualise": "visualize",
1697
+ "visualised": "visualized",
1698
+ "visualises": "visualizes",
1699
+ "visualising": "visualizing",
1700
+ "vocalisation": "vocalization",
1701
+ "vocalisations": "vocalizations",
1702
+ "vocalise": "vocalize",
1703
+ "vocalised": "vocalized",
1704
+ "vocalises": "vocalizes",
1705
+ "vocalising": "vocalizing",
1706
+ "vulcanised": "vulcanized",
1707
+ "vulgarisation": "vulgarization",
1708
+ "vulgarise": "vulgarize",
1709
+ "vulgarised": "vulgarized",
1710
+ "vulgarises": "vulgarizes",
1711
+ "vulgarising": "vulgarizing",
1712
+ "waggon": "wagon",
1713
+ "waggons": "wagons",
1714
+ "watercolour": "watercolor",
1715
+ "watercolours": "watercolors",
1716
+ "weaselled": "weaseled",
1717
+ "weaselling": "weaseling",
1718
+ "westernisation": "westernization",
1719
+ "westernise": "westernize",
1720
+ "westernised": "westernized",
1721
+ "westernises": "westernizes",
1722
+ "westernising": "westernizing",
1723
+ "womanise": "womanize",
1724
+ "womanised": "womanized",
1725
+ "womaniser": "womanizer",
1726
+ "womanisers": "womanizers",
1727
+ "womanises": "womanizes",
1728
+ "womanising": "womanizing",
1729
+ "woollen": "woolen",
1730
+ "woollens": "woolens",
1731
+ "woollies": "woolies",
1732
+ "woolly": "wooly",
1733
+ "worshipped": "worshiped",
1734
+ "worshipper": "worshiper",
1735
+ "worshipping": "worshiping",
1736
+ "yodelled": "yodeled",
1737
+ "yodelling": "yodeling",
1738
+ "yoghourt": "yogurt",
1739
+ "yoghourts": "yogurts",
1740
+ "yoghurt": "yogurt",
1741
+ "yoghurts": "yogurts"
1742
+ }
patch_func.py ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+
4
+
5
+ def partial_rope_mask(model_args, mha2mla_args):
6
+ """
7
+ Generate different types of masks for partial rotary position embeddings (RoPE)
8
+ based on configuration settings.
9
+ Returns:
10
+ Appropriate mask tensor based on the specified version
11
+ """
12
+ n_head = model_args.encoder_attention_heads
13
+ # MODIFIED (MHA adaptation): upstream hardcoded n_k_head=1 (a GQA / MLA-target assumption).
14
+ # Whisper is MHA — its k has n_head heads — so the k-side rope mask must span all heads for
15
+ # partial-preservation to partition keys correctly. (No effect on full_k_svd, which ignores
16
+ # k_c_indices and deletes k_r_proj.)
17
+ n_k_head = n_head
18
+ if hasattr(model_args, "head_dim") and model_args.head_dim:
19
+ d_head = model_args.head_dim
20
+ else:
21
+ # MODIFIED (prior-art §6 fix #1): upstream used d_head = d_model here (768 for
22
+ # whisper-small), corrupting the rope mask; the per-head dim is d_model // n_head.
23
+ d_head = model_args.d_model // n_head
24
+ d_head_half = d_head // 2
25
+ rope_dim_for_mla = mha2mla_args.rope_dim_for_mla
26
+ rope_dim_for_mla_half = rope_dim_for_mla // 2
27
+ rope_version = mha2mla_args.partial_rope_version
28
+ mask = torch.zeros(d_head)
29
+
30
+ def select_high_frequency(mask):
31
+ """
32
+ Select high-frequency components (first rope_dim_for_mla dimensions)
33
+ Returns:
34
+ mask: Binary mask with 1s for the first rope_dim_for_mla dimensions
35
+ """
36
+ mask[:rope_dim_for_mla_half] = 1
37
+ mask[d_head_half : d_head_half + rope_dim_for_mla_half] = 1
38
+ q_masks = mask.repeat(n_head).bool()
39
+ k_masks = mask.repeat(n_k_head).bool()
40
+ return q_masks, k_masks
41
+
42
+ def select_low_frequency(mask):
43
+ """
44
+ Select low-frequency components (last rope_dim_for_mla dimensions)
45
+ Returns:
46
+ mask: Binary mask with 1s for the last rope_dim_for_mla dimensions
47
+ """
48
+ mask[d_head - rope_dim_for_mla_half :] = 1
49
+ mask[d_head_half - rope_dim_for_mla_half : d_head_half] = 1
50
+ q_masks = mask.repeat(n_head).bool()
51
+ k_masks = mask.repeat(n_k_head).bool()
52
+ return q_masks, k_masks
53
+
54
+ def select_uniform_frequency(mask, start_point):
55
+ """
56
+ Select uniformly distributed dimensions for RoPE
57
+ Returns:
58
+ mask: Binary mask with 1s at uniformly spaced positions
59
+ """
60
+ step = d_head // rope_dim_for_mla
61
+ assert d_head_half % step == 0, "rope_dim_for_mla must be greater than 0"
62
+
63
+ for i in range(start_point, d_head, step):
64
+ mask[i] = 1
65
+ # MODIFIED (prior-art §6): repeat across heads like the high/low paths — q over n_head,
66
+ # k over n_k_head. Upstream returned the un-repeated per-head mask, which mis-sizes q_proj
67
+ # for MHA Whisper once d_head is the correct per-head 64 (fix #1).
68
+ q_masks = mask.repeat(n_head).bool()
69
+ k_masks = mask.repeat(n_k_head).bool()
70
+ return q_masks, k_masks
71
+
72
+ def select_2norm_frequency(mask, rope_dim_for_mla):
73
+ """
74
+ Select dimensions based on 2-norm frequency importance
75
+ Returns:
76
+ mask: Binary mask with 1s for the top rope_dim_for_mla dimensions by 2-norm
77
+ """
78
+ # This is a placeholder implementation since the exact 2-norm selection
79
+ # method was not detailed in the comments. In practice, this would
80
+ # require statistics from the weight matrices to determine importance.
81
+ with open(mha2mla_args.qk_tensor_path, "rb") as fin:
82
+ qk_norm_rank = torch.load(fin, weights_only=True)
83
+
84
+ k_masks = qk_norm_rank < rope_dim_for_mla_half
85
+ if mha2mla_args.is_gqa2mha2mla:
86
+ q_masks = k_masks
87
+ else:
88
+ q_masks = k_masks
89
+ k_masks = k_masks.view(k_masks.size(0), -1)
90
+ q_masks = q_masks.view(q_masks.size(0), -1)
91
+ return q_masks, k_masks
92
+
93
+ if rope_version == "high":
94
+ return select_high_frequency(mask)
95
+ elif rope_version == "low":
96
+ return select_low_frequency(mask)
97
+ elif rope_version == "uniform":
98
+ return select_uniform_frequency(mask, mha2mla_args.uniform_start_point)
99
+ elif rope_version == "2-norm":
100
+ return select_2norm_frequency(d_head, rope_dim_for_mla)
101
+
102
+
103
+ class LowRankKVLinear(nn.Module):
104
+ """
105
+ A low-rank approximation of a linear layer.
106
+ Instead of storing a full matrix W of shape (out_features, in_features),
107
+ it stores two matrices: down of shape (in_features, low_rank) and
108
+ up of shape (low_rank, out_features), such that W ≈ up.T @ down.T
109
+ """
110
+
111
+ def __init__(
112
+ self,
113
+ d_in,
114
+ d_k_out,
115
+ d_v_out,
116
+ d_mid=0,
117
+ k_approx=False,
118
+ v_approx=False,
119
+ kv_joint=False,
120
+ bias=None,
121
+ ):
122
+ super().__init__()
123
+ # TODO: add activations after down_kv
124
+ if kv_joint: # (x * W_q)* (x * down_kv * up_k)
125
+ self.down_kv = nn.Linear(in_features=d_in, out_features=d_mid, bias=False)
126
+ if not kv_joint and k_approx:
127
+ self.down_k = nn.Linear(in_features=d_in, out_features=d_mid, bias=False)
128
+ if not kv_joint and v_approx:
129
+ self.down_v = nn.Linear(in_features=d_in, out_features=d_mid, bias=False)
130
+
131
+ d_k_in = d_mid if k_approx else d_in
132
+ self.up_k = nn.Linear(in_features=d_k_in, out_features=d_k_out, bias=True)
133
+ d_v_in = d_mid if v_approx else d_in
134
+ self.up_v = nn.Linear(in_features=d_v_in, out_features=d_v_out, bias=True)
135
+
136
+ def reset_parameters(
137
+ self,
138
+ down_kv_weight=None,
139
+ down_k_weight=None,
140
+ down_v_weight=None,
141
+ up_k_weight=None,
142
+ up_v_weight=None,
143
+ up_k_bias=None,
144
+ up_v_bias=None,
145
+ ):
146
+ if down_kv_weight is not None:
147
+ self.down_kv.weight.data.copy_(down_kv_weight)
148
+ if down_k_weight is not None:
149
+ self.down_k.weight.data.copy_(down_k_weight)
150
+ if down_v_weight is not None:
151
+ self.down_v.weight.data.copy_(down_v_weight)
152
+ if up_k_weight is not None:
153
+ self.up_k.weight.data.copy_(up_k_weight)
154
+ if up_v_weight is not None:
155
+ self.up_v.weight.data.copy_(up_v_weight)
156
+ if up_k_bias is not None:
157
+ self.up_k.bias.data.copy_(up_k_bias)
158
+ if up_v_bias is not None:
159
+ self.up_v.bias.data.copy_(up_v_bias)
160
+
161
+ def mha_forward(self, x):
162
+ # x: (batch_size, seq_len, in_features)
163
+ if hasattr(self, "down_kv"):
164
+ k = v = self.down_kv(x)
165
+ else:
166
+ k = self.down_k(x) if hasattr(self, "down_k") else x
167
+ v = self.down_v(x) if hasattr(self, "down_v") else x
168
+ k = self.up_k(k)
169
+ v = self.up_v(v)
170
+ return k, v
171
+
172
+ def kv_forward(self, x):
173
+ kv = self.down_kv(x)
174
+ # TODO: Triton kernel
175
+ return kv
176
+
177
+ def kv_up(self, x):
178
+ k = self.up_k(x)
179
+ v = self.up_v(x)
180
+ return k, v
181
+
182
+
183
+ def SVD(X, r):
184
+ U, S, V = torch.linalg.svd(X.to(torch.float32), full_matrices=False)
185
+ U, S, V = U[:, :r], S[:r], V[:r, :]
186
+ U @= torch.diag(S)
187
+ return V, U
188
+
189
+
190
+ def svd_low_rank_approx(k_c_weight, k_c_bias, v_weight, v_bias, d_kv_mid, method):
191
+ d_k_c, d_v, d_kv_in = k_c_weight.size(0), v_weight.size(0), v_weight.size(1)
192
+ has_bias = k_c_bias is not None
193
+
194
+ if method == "only_key":
195
+ down_k, up_k = SVD(k_c_weight, d_kv_mid)
196
+ kv_proj = LowRankKVLinear(
197
+ d_kv_in, d_k_c, d_v, d_mid=d_kv_mid, k_approx=True, bias=has_bias
198
+ )
199
+ kv_proj.reset_parameters(
200
+ down_k_weight=down_k,
201
+ up_k_weight=up_k,
202
+ up_v_weight=v_weight,
203
+ up_k_bias=k_c_bias,
204
+ up_v_bias=v_bias,
205
+ )
206
+ elif method == "only_value":
207
+ down_v, up_v = SVD(v_weight, d_kv_mid)
208
+ kv_proj = LowRankKVLinear(
209
+ d_kv_in, d_k_c, d_v, d_mid=d_kv_mid, v_approx=True, bias=has_bias
210
+ )
211
+ kv_proj.reset_parameters(
212
+ down_v_weight=down_v,
213
+ up_k_weight=k_c_weight,
214
+ up_v_weight=up_v,
215
+ up_k_bias=k_c_bias,
216
+ up_v_bias=v_bias,
217
+ )
218
+ elif method == "split":
219
+ down_k, up_k = SVD(k_c_weight, d_kv_mid)
220
+ down_v, up_v = SVD(v_weight, d_kv_mid)
221
+ kv_proj = LowRankKVLinear(
222
+ d_kv_in,
223
+ d_k_c,
224
+ d_v,
225
+ d_mid=d_kv_mid,
226
+ k_approx=True,
227
+ v_approx=True,
228
+ bias=has_bias,
229
+ )
230
+ kv_proj.reset_parameters(
231
+ down_k_weight=down_k,
232
+ down_v_weight=down_v,
233
+ up_k_weight=up_k,
234
+ up_v_weight=up_v,
235
+ up_k_bias=k_c_bias,
236
+ up_v_bias=v_bias,
237
+ )
238
+ elif method == "joint":
239
+ joint_kv = torch.cat([k_c_weight, v_weight])
240
+ down_kv, up_kv = SVD(joint_kv, d_kv_mid)
241
+ up_k, up_v = up_kv.split([d_k_c, d_v])
242
+ kv_proj = LowRankKVLinear(
243
+ d_kv_in,
244
+ d_k_c,
245
+ d_v,
246
+ d_mid=d_kv_mid,
247
+ k_approx=True,
248
+ v_approx=True,
249
+ kv_joint=True,
250
+ bias=has_bias,
251
+ )
252
+ kv_proj.reset_parameters(
253
+ down_kv_weight=down_kv,
254
+ up_k_weight=up_k,
255
+ up_v_weight=up_v,
256
+ up_k_bias=k_c_bias,
257
+ up_v_bias=v_bias,
258
+ )
259
+ elif method == "none":
260
+ kv_proj = LowRankKVLinear(d_kv_in, d_k_c, d_v, bias=has_bias)
261
+ kv_proj.reset_parameters(
262
+ up_k_weight=k_c_weight,
263
+ up_v_weight=v_weight,
264
+ up_k_bias=k_c_bias,
265
+ up_v_bias=v_bias,
266
+ )
267
+ return kv_proj
patching_model_load.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+
3
+ import torch
4
+ import torch.nn as nn
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+ from .patch_func import partial_rope_mask, svd_low_rank_approx
9
+ from . import modeling_whisper
10
+ from .modeling_whisper import WhisperAttention
11
+
12
+
13
+ def reorder_matrix_rows(mask, is_cat=False):
14
+ """
15
+ Reorder rows in a matrix based on a binary mask.
16
+ Rows corresponding to 1s in the mask come first, then rows corresponding to 0s.
17
+
18
+ Args:
19
+ weight: The weight matrix to reorder
20
+ mask: A binary mask (list or tensor) of length equal to weight.shape[0]
21
+
22
+ Returns:
23
+ The reordered weight matrix
24
+ """
25
+ ones_indices = torch.where(mask)[0]
26
+ zeros_indices = torch.where(~mask)[0]
27
+ if is_cat:
28
+ return torch.cat([ones_indices, zeros_indices])
29
+ else:
30
+ return ones_indices, zeros_indices
31
+
32
+
33
+ def patch_model(model, model_args, mha2mla_args):
34
+ """
35
+ Patch a huggingface model by:
36
+ 1. Reordering rows in q_proj and k_proj matrices based on a partial-rope mask
37
+ 2. Replacing v_proj with a low-rank approximation
38
+
39
+ Args:
40
+ model: The Qwen2ForCausalLM model
41
+ mask: A binary mask for reordering q_proj and k_proj
42
+ low_rank: The rank for the low-rank approximation of v_proj
43
+ """
44
+ q_masks, k_masks = partial_rope_mask(model_args, mha2mla_args)
45
+
46
+ n_head = model_args.encoder_attention_heads
47
+ n_k_head = n_head # MHA: k has n_head heads (matches partial_rope_mask)
48
+ if hasattr(model_args, "head_dim"):
49
+ d_head = model_args.head_dim
50
+ else:
51
+ d_head = model_args.d_model // n_head
52
+ q_idx = []
53
+ k_idx = []
54
+ layer_idx = 0
55
+ targets = getattr(mha2mla_args, "targets", None) # set of roles to convert; None = all (§6 #2)
56
+ preserve = getattr(mha2mla_args, "preserve_rope", False)
57
+ for name, layer in model.named_modules():
58
+ if not isinstance(layer, WhisperAttention):
59
+ continue
60
+ # scope gating: classify the module by name and skip if outside the requested scope.
61
+ if "encoder_attn" in name:
62
+ role = "decoder_cross"
63
+ elif "decoder" in name:
64
+ role = "decoder_self"
65
+ else:
66
+ role = "encoder_self"
67
+ if targets is not None and role not in targets:
68
+ continue
69
+ q_weight = layer.q_proj.weight
70
+ q_bias = getattr(layer.q_proj, "bias", None)
71
+
72
+ # Reorder q_proj rows (rope dims first) ONLY for partial_preservation, whose split forward
73
+ # regroups per-head. full_k_svd keeps k in original order (nosplit forward), so permuting q
74
+ # there would twist q.k — leave q untouched.
75
+ q_mask = q_masks[layer_idx] if len(q_masks.shape) == 2 else q_masks
76
+ q_indices = reorder_matrix_rows(q_mask, is_cat=True)
77
+ if preserve:
78
+ layer.q_proj.weight.data.copy_(q_weight[q_indices])
79
+ if q_bias is not None:
80
+ layer.q_proj.bias.data.copy_(q_bias[q_indices])
81
+
82
+ # 2. Reorder k_proj and setup k_r_proj
83
+ # Get original weights and biases if biases exist
84
+ k_weight = layer.k_proj.weight
85
+ if mha2mla_args.is_gqa2mha2mla:
86
+ k_weight = (
87
+ k_weight.view(n_k_head, -1, k_weight.size(-1))
88
+ .repeat_interleave(n_head // n_k_head, dim=0)
89
+ .view(-1, k_weight.size(-1))
90
+ )
91
+ k_bias = getattr(layer.k_proj, "bias", None)
92
+
93
+ # Reorder and update weights and biases if biases exist
94
+ k_mask = k_masks[layer_idx] if len(k_masks.shape) == 2 else k_masks
95
+ k_r_indices, k_c_indices = reorder_matrix_rows(k_mask, is_cat=False)
96
+ k_r_proj = nn.Linear(k_weight.size(1), k_r_indices.size(0), k_bias is not None)
97
+ k_r_proj.weight.data.copy_(k_weight[k_r_indices])
98
+ if k_bias is not None:
99
+ k_r_proj.bias.data.copy_(k_bias[k_r_indices])
100
+ layer.k_r_proj = k_r_proj
101
+
102
+ # Reorder Q_Norm/K_Norm (e.g., Qwen3) if exist
103
+ if hasattr(layer, "q_norm"):
104
+ # TODO: support olmo's Q_Norm/K_Norm
105
+ assert mha2mla_args.partial_rope_version != "2_norm", (
106
+ "Qwen3 does not suppert 2_norm yet."
107
+ )
108
+ norm_indices = reorder_matrix_rows(q_mask[:d_head], is_cat=True)
109
+ qn_weight = layer.self_attn.q_norm.weight
110
+ kn_weight = layer.self_attn.k_norm.weight
111
+ layer.self_attn.q_norm.weight.data.copy_(qn_weight[norm_indices])
112
+ layer.self_attn.k_norm.weight.data.copy_(kn_weight[norm_indices])
113
+
114
+ # 3. Setup low-rank kv_proj (§6 #3): partial-preservation compresses only the non-rope
115
+ # rows k_weight[k_c_indices]; full_k_svd compresses the full key.
116
+ if preserve:
117
+ k_c_weight = k_weight[k_c_indices]
118
+ k_c_bias = k_bias[k_c_indices] if k_bias is not None else None
119
+ else:
120
+ k_c_weight = k_weight
121
+ k_c_bias = k_bias if k_bias is not None else None
122
+ kv_proj = svd_low_rank_approx(
123
+ k_c_weight=k_c_weight,
124
+ k_c_bias=k_c_bias,
125
+ v_weight=layer.v_proj.weight,
126
+ v_bias=getattr(layer.v_proj, "bias", None),
127
+ d_kv_mid=mha2mla_args.low_rank * model_args.num_key_value_heads,
128
+ method=mha2mla_args.svd_init_method,
129
+ )
130
+ layer.kv_proj = kv_proj
131
+
132
+ # 4. Delete original k_proj/v_proj; keep k_r_proj only for partial-preservation (§6 #4 —
133
+ # the split forward reconstructs key = cat(k_r_proj(x), kv_proj.up_k(...))).
134
+ delattr(layer, "k_proj")
135
+ delattr(layer, "v_proj")
136
+ if not preserve:
137
+ delattr(layer, "k_r_proj")
138
+
139
+ d_q_r = n_head * mha2mla_args.rope_dim_for_mla
140
+ q_idx.append(q_indices[:d_q_r])
141
+ k_idx.append(k_r_indices)
142
+ logger.debug("Layer %d: set up q_proj, k_r_proj, and kv_proj", layer_idx)
143
+
144
+ # 5. [Optional] Randomly init if is_mla_from_scratch == True
145
+ if mha2mla_args.is_mla_from_scratch:
146
+ std = model_args.initializer_range
147
+ for name, param in layer.self_attn.named_parameters():
148
+ if "o_proj" in name or "proj" not in name:
149
+ continue
150
+ if "weight" in name:
151
+ param.data.normal_(mean=0.0, std=std)
152
+ print(f"Reinit {name}")
153
+ if "bias" in name:
154
+ param.data.zero_()
155
+ print(f"Reinit {name}")
156
+
157
+ layer_idx = layer_idx + 1
158
+
159
+ return model, q_idx, k_idx
patching_whisper.py ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import inspect
2
+ from typing import Callable, Optional, Tuple
3
+
4
+ import torch
5
+ from transformers import Cache
6
+ from transformers.utils import logging
7
+ from transformers.processing_utils import Unpack
8
+ from . import modeling_whisper
9
+ from .modeling_whisper import WhisperAttention, WhisperDecoderLayer
10
+ from torch import nn
11
+ import types
12
+
13
+
14
+ logger = logging.get_logger(__name__)
15
+
16
+
17
+ def _mla_split_heads(states, num_heads, n_rope):
18
+ """Reshape a [rope(all heads) | pass(all heads)] projection to (bsz, num_heads, seq, head_dim)
19
+ WITHOUT scrambling heads: split the rope/pass sections and reshape each PER-HEAD, then concat
20
+ within head. Fixes the cross-head reshape flaw (a flat reshape pooled dims from different
21
+ original heads under one softmax)."""
22
+ bsz, seq, dim = states.shape
23
+ rope = states[..., :n_rope].reshape(bsz, seq, num_heads, n_rope // num_heads)
24
+ pas = states[..., n_rope:].reshape(bsz, seq, num_heads, (dim - n_rope) // num_heads)
25
+ return torch.cat([rope, pas], dim=-1).transpose(1, 2).contiguous()
26
+
27
+
28
+ def _mla_key_from_parts(key_r, key_c, num_heads):
29
+ """Assemble the split-scheme key per-head from its preserved (key_r) + compressed (key_c) parts,
30
+ keeping heads intact -> (bsz, num_heads, seq, head_dim)."""
31
+ bsz, seq = key_r.shape[0], key_r.shape[1]
32
+ r = key_r.reshape(bsz, seq, num_heads, key_r.size(-1) // num_heads)
33
+ c = key_c.reshape(bsz, seq, num_heads, key_c.size(-1) // num_heads)
34
+ return torch.cat([r, c], dim=-1).transpose(1, 2).contiguous()
35
+
36
+
37
+ def custom_WhisperAttention_mla_forward(
38
+ self,
39
+ hidden_states: torch.Tensor,
40
+ attention_mask: Optional[torch.Tensor],
41
+ past_key_value: Optional[Cache] = None,
42
+ key_value_states: Optional[torch.Tensor] = None,
43
+ cache_position: Optional[torch.LongTensor] = None,
44
+ layer_head_mask: Optional[torch.Tensor] = None,
45
+ output_attentions: bool = False,
46
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
47
+ is_cross_attention = key_value_states is not None
48
+ bsz, tgt_len, _ = hidden_states.size()
49
+ input_shape = hidden_states.shape[:-1]
50
+ kv_shape = (*input_shape, 1, -1)
51
+ num_q_heads = 12
52
+ q_shape = (*input_shape, num_q_heads, -1)
53
+ query_states = self.q_proj(hidden_states) * self.scaling
54
+ if (
55
+ is_cross_attention
56
+ and past_key_value is not None
57
+ and past_key_value[0].shape[1] == key_value_states.shape[1]
58
+ ):
59
+ # reuse k,v, cross_attentions
60
+ kv_states = past_key_value[0]
61
+ key_r_states = past_key_value[1]
62
+ key_c_states, value_states = self.kv_proj.kv_up(kv_states)
63
+ key_states = _mla_key_from_parts(key_r_states, key_c_states, self.num_heads)
64
+ value_states = self._shape(value_states, -1, bsz)
65
+ # NOTE: value_states = self.v_proj(hidden_states)
66
+ elif is_cross_attention:
67
+ kv_states = self.kv_proj.kv_forward(key_value_states)
68
+ key_c_states, value_states = self.kv_proj.kv_up(kv_states)
69
+ key_r_states = self.k_r_proj(key_value_states)
70
+ key_states = _mla_key_from_parts(key_r_states, key_c_states, self.num_heads)
71
+ value_states = self._shape(value_states, -1, bsz)
72
+ elif past_key_value is not None:
73
+ kv_states = self.kv_proj.kv_forward(hidden_states)
74
+ kv_states = torch.cat([past_key_value[0], kv_states], dim=1)
75
+ key_c_states, value_states = self.kv_proj.kv_up(kv_states)
76
+ key_r_states = self.k_r_proj(hidden_states)
77
+ key_r_states = torch.cat([past_key_value[1], key_r_states], dim=1)
78
+ key_states = _mla_key_from_parts(key_r_states, key_c_states, self.num_heads)
79
+ value_states = self._shape(value_states, -1, bsz)
80
+ else:
81
+ kv_states = self.kv_proj.kv_forward(hidden_states)
82
+ key_c_states, value_states = self.kv_proj.kv_up(kv_states)
83
+ key_r_states = self.k_r_proj(hidden_states)
84
+ key_states = _mla_key_from_parts(key_r_states, key_c_states, self.num_heads)
85
+ value_states = self._shape(value_states, -1, bsz)
86
+
87
+ # NOTE: the code below has not been modified.
88
+ if self.is_decoder:
89
+ # if cross_attention save Tuple(torch.Tensor, torch.Tensor) of all cross attention key/value_states.
90
+ # Further calls to cross_attention layer can then reuse all cross-attention
91
+ # key/value_states (first "if" case)
92
+ # if uni-directional self-attention (decoder) save Tuple(torch.Tensor, torch.Tensor) of
93
+ # all previous decoder key/value_states. Further calls to uni-directional self-attention
94
+ # can concat previous decoder key/value_states to current projected key/value_states (third "elif" case)
95
+ # if encoder bi-directional self-attention `past_key_value` is always `None`
96
+ past_key_value = (kv_states, key_r_states)
97
+
98
+ proj_shape = (bsz * self.num_heads, -1, self.head_dim)
99
+ # PER-HEAD reshape (q is reordered [rope|pass]); rope section width == key_r width.
100
+ query_states = _mla_split_heads(query_states, self.num_heads, key_r_states.size(-1)).reshape(*proj_shape)
101
+ key_states = key_states.reshape(*proj_shape)
102
+ value_states = value_states.reshape(*proj_shape)
103
+
104
+ src_len = key_states.size(1)
105
+ attn_weights = torch.bmm(query_states, key_states.transpose(1, 2))
106
+
107
+ if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
108
+ raise ValueError(
109
+ f"Attention weights should be of size {(bsz * self.num_heads, tgt_len, src_len)}, but is"
110
+ f" {attn_weights.size()}"
111
+ )
112
+
113
+ if attention_mask is not None:
114
+ if attention_mask.size() != (bsz, 1, tgt_len, src_len):
115
+ raise ValueError(
116
+ f"Attention mask should be of size {(bsz, 1, tgt_len, src_len)}, but is {attention_mask.size()}"
117
+ )
118
+ attn_weights = attn_weights.view(bsz, self.num_heads, tgt_len, src_len) + attention_mask
119
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
120
+
121
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1)
122
+
123
+ if layer_head_mask is not None:
124
+ if layer_head_mask.size() != (self.num_heads,):
125
+ raise ValueError(
126
+ f"Head mask for a single layer should be of size {(self.num_heads,)}, but is"
127
+ f" {layer_head_mask.size()}"
128
+ )
129
+ attn_weights = layer_head_mask.view(1, -1, 1, 1) * attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
130
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
131
+
132
+ if output_attentions:
133
+ attn_weights_reshaped = attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
134
+ attn_weights = attn_weights_reshaped.view(bsz * self.num_heads, tgt_len, src_len)
135
+ else:
136
+ attn_weights_reshaped = None
137
+
138
+ attn_probs = nn.functional.dropout(attn_weights, p=self.dropout, training=self.training)
139
+
140
+ attn_output = torch.bmm(attn_probs, value_states)
141
+
142
+ if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
143
+ raise ValueError(
144
+ f"`attn_output` should be of size {(bsz * self.num_heads, tgt_len, self.head_dim)}, but is"
145
+ f" {attn_output.size()}"
146
+ )
147
+
148
+ attn_output = attn_output.view(bsz, self.num_heads, tgt_len, self.head_dim)
149
+ attn_output = attn_output.transpose(1, 2)
150
+
151
+ attn_output = attn_output.reshape(bsz, tgt_len, self.embed_dim)
152
+
153
+ attn_output = self.out_proj(attn_output)
154
+
155
+ return attn_output, attn_weights_reshaped, past_key_value
156
+
157
+
158
+ def custom_WhisperAttention_nosplit_forward(
159
+ self,
160
+ hidden_states: torch.Tensor,
161
+ attention_mask: Optional[torch.Tensor],
162
+ past_key_value: Optional[Cache] = None,
163
+ key_value_states: Optional[torch.Tensor] = None,
164
+ cache_position: Optional[torch.LongTensor] = None,
165
+ layer_head_mask: Optional[torch.Tensor] = None,
166
+ output_attentions: bool = False,
167
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
168
+ is_cross_attention = key_value_states is not None
169
+ bsz, tgt_len, _ = hidden_states.size()
170
+ input_shape = hidden_states.shape[:-1]
171
+ kv_shape = (*input_shape, 1, -1)
172
+ num_q_heads = 12
173
+ q_shape = (*input_shape, num_q_heads, -1)
174
+ query_states = self.q_proj(hidden_states) * self.scaling
175
+ if (
176
+ is_cross_attention
177
+ and past_key_value is not None
178
+ and past_key_value[0].shape[1] == key_value_states.shape[1]
179
+ ):
180
+ # reuse k,v, cross_attentions
181
+ kv_states = past_key_value[0]
182
+ key_states, value_states = self.kv_proj.kv_up(kv_states)
183
+ key_states = self._shape(key_states, -1, bsz)
184
+ value_states = self._shape(value_states, -1, bsz)
185
+ # NOTE: value_states = self.v_proj(hidden_states)
186
+ elif is_cross_attention:
187
+ kv_states = self.kv_proj.kv_forward(key_value_states)
188
+ key_states, value_states = self.kv_proj.kv_up(kv_states)
189
+ key_states = self._shape(key_states, -1, bsz)
190
+ value_states = self._shape(value_states, -1, bsz)
191
+ elif past_key_value is not None:
192
+ kv_states = self.kv_proj.kv_forward(hidden_states)
193
+ kv_states = torch.cat([past_key_value[0], kv_states], dim=1)
194
+ key_states, value_states = self.kv_proj.kv_up(kv_states)
195
+ key_states = self._shape(key_states, -1, bsz)
196
+ value_states = self._shape(value_states, -1, bsz)
197
+ else:
198
+ kv_states = self.kv_proj.kv_forward(hidden_states)
199
+ key_states, value_states = self.kv_proj.kv_up(kv_states)
200
+ key_states = self._shape(key_states, -1, bsz)
201
+ value_states = self._shape(value_states, -1, bsz)
202
+
203
+ # NOTE: the code below has not been modified.
204
+ if (self.is_decoder) and not is_cross_attention:
205
+ # if cross_attention save Tuple(torch.Tensor, torch.Tensor) of all cross attention key/value_states.
206
+ # Further calls to cross_attention layer can then reuse all cross-attention
207
+ # key/value_states (first "if" case)
208
+ # if uni-directional self-attention (decoder) save Tuple(torch.Tensor, torch.Tensor) of
209
+ # all previous decoder key/value_states. Further calls to uni-directional self-attention
210
+ # can concat previous decoder key/value_states to current projected key/value_states (third "elif" case)
211
+ # if encoder bi-directional self-attention `past_key_value` is always `None`
212
+ past_key_value = (kv_states, )
213
+
214
+ proj_shape = (bsz * self.num_heads, -1, self.head_dim)
215
+ query_states = self._shape(query_states, tgt_len, bsz).view(*proj_shape)
216
+ key_states = key_states.reshape(*proj_shape)
217
+ value_states = value_states.reshape(*proj_shape)
218
+
219
+ src_len = key_states.size(1)
220
+ attn_weights = torch.bmm(query_states, key_states.transpose(1, 2))
221
+
222
+ if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
223
+ raise ValueError(
224
+ f"Attention weights should be of size {(bsz * self.num_heads, tgt_len, src_len)}, but is"
225
+ f" {attn_weights.size()}"
226
+ )
227
+
228
+ if attention_mask is not None:
229
+ if attention_mask.size() != (bsz, 1, tgt_len, src_len):
230
+ raise ValueError(
231
+ f"Attention mask should be of size {(bsz, 1, tgt_len, src_len)}, but is {attention_mask.size()}"
232
+ )
233
+ attn_weights = attn_weights.view(bsz, self.num_heads, tgt_len, src_len) + attention_mask
234
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
235
+
236
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1)
237
+
238
+ if layer_head_mask is not None:
239
+ if layer_head_mask.size() != (self.num_heads,):
240
+ raise ValueError(
241
+ f"Head mask for a single layer should be of size {(self.num_heads,)}, but is"
242
+ f" {layer_head_mask.size()}"
243
+ )
244
+ attn_weights = layer_head_mask.view(1, -1, 1, 1) * attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
245
+ attn_weights = attn_weights.view(bsz * self.num_heads, tgt_len, src_len)
246
+
247
+ if output_attentions:
248
+ attn_weights_reshaped = attn_weights.view(bsz, self.num_heads, tgt_len, src_len)
249
+ attn_weights = attn_weights_reshaped.view(bsz * self.num_heads, tgt_len, src_len)
250
+ else:
251
+ attn_weights_reshaped = None
252
+
253
+ attn_probs = nn.functional.dropout(attn_weights, p=self.dropout, training=self.training)
254
+
255
+ attn_output = torch.bmm(attn_probs, value_states)
256
+
257
+ if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
258
+ raise ValueError(
259
+ f"`attn_output` should be of size {(bsz * self.num_heads, tgt_len, self.head_dim)}, but is"
260
+ f" {attn_output.size()}"
261
+ )
262
+
263
+ attn_output = attn_output.view(bsz, self.num_heads, tgt_len, self.head_dim)
264
+ attn_output = attn_output.transpose(1, 2)
265
+
266
+ attn_output = attn_output.reshape(bsz, tgt_len, self.embed_dim)
267
+
268
+ attn_output = self.out_proj(attn_output)
269
+
270
+ return attn_output, attn_weights_reshaped, past_key_value
271
+
272
+
273
+ '''def mha2mla_mla_whisper(model):
274
+ for module in model.modules():
275
+ if isinstance(module, WhisperDecoderLayer):
276
+ module.self_attn.forward = types.MethodType(
277
+ custom_WhisperAttention_mla_forward,
278
+ module.self_attn
279
+ )'''
280
+ def mha2mla_mla_whisper(_model=None):
281
+ WhisperAttention.forward = custom_WhisperAttention_nosplit_forward
preprocessor_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length": 30,
3
+ "feature_extractor_type": "WhisperFeatureExtractor",
4
+ "feature_size": 80,
5
+ "hop_length": 160,
6
+ "n_fft": 400,
7
+ "n_samples": 480000,
8
+ "nb_max_frames": 3000,
9
+ "padding_side": "right",
10
+ "padding_value": 0.0,
11
+ "processor_class": "WhisperProcessor",
12
+ "return_attention_mask": false,
13
+ "sampling_rate": 16000
14
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "<|startoftranscript|>",
5
+ "<|en|>",
6
+ "<|zh|>",
7
+ "<|de|>",
8
+ "<|es|>",
9
+ "<|ru|>",
10
+ "<|ko|>",
11
+ "<|fr|>",
12
+ "<|ja|>",
13
+ "<|pt|>",
14
+ "<|tr|>",
15
+ "<|pl|>",
16
+ "<|ca|>",
17
+ "<|nl|>",
18
+ "<|ar|>",
19
+ "<|sv|>",
20
+ "<|it|>",
21
+ "<|id|>",
22
+ "<|hi|>",
23
+ "<|fi|>",
24
+ "<|vi|>",
25
+ "<|he|>",
26
+ "<|uk|>",
27
+ "<|el|>",
28
+ "<|ms|>",
29
+ "<|cs|>",
30
+ "<|ro|>",
31
+ "<|da|>",
32
+ "<|hu|>",
33
+ "<|ta|>",
34
+ "<|no|>",
35
+ "<|th|>",
36
+ "<|ur|>",
37
+ "<|hr|>",
38
+ "<|bg|>",
39
+ "<|lt|>",
40
+ "<|la|>",
41
+ "<|mi|>",
42
+ "<|ml|>",
43
+ "<|cy|>",
44
+ "<|sk|>",
45
+ "<|te|>",
46
+ "<|fa|>",
47
+ "<|lv|>",
48
+ "<|bn|>",
49
+ "<|sr|>",
50
+ "<|az|>",
51
+ "<|sl|>",
52
+ "<|kn|>",
53
+ "<|et|>",
54
+ "<|mk|>",
55
+ "<|br|>",
56
+ "<|eu|>",
57
+ "<|is|>",
58
+ "<|hy|>",
59
+ "<|ne|>",
60
+ "<|mn|>",
61
+ "<|bs|>",
62
+ "<|kk|>",
63
+ "<|sq|>",
64
+ "<|sw|>",
65
+ "<|gl|>",
66
+ "<|mr|>",
67
+ "<|pa|>",
68
+ "<|si|>",
69
+ "<|km|>",
70
+ "<|sn|>",
71
+ "<|yo|>",
72
+ "<|so|>",
73
+ "<|af|>",
74
+ "<|oc|>",
75
+ "<|ka|>",
76
+ "<|be|>",
77
+ "<|tg|>",
78
+ "<|sd|>",
79
+ "<|gu|>",
80
+ "<|am|>",
81
+ "<|yi|>",
82
+ "<|lo|>",
83
+ "<|uz|>",
84
+ "<|fo|>",
85
+ "<|ht|>",
86
+ "<|ps|>",
87
+ "<|tk|>",
88
+ "<|nn|>",
89
+ "<|mt|>",
90
+ "<|sa|>",
91
+ "<|lb|>",
92
+ "<|my|>",
93
+ "<|bo|>",
94
+ "<|tl|>",
95
+ "<|mg|>",
96
+ "<|as|>",
97
+ "<|tt|>",
98
+ "<|haw|>",
99
+ "<|ln|>",
100
+ "<|ha|>",
101
+ "<|ba|>",
102
+ "<|jw|>",
103
+ "<|su|>",
104
+ "<|translate|>",
105
+ "<|transcribe|>",
106
+ "<|startoflm|>",
107
+ "<|startofprev|>",
108
+ "<|nocaptions|>",
109
+ "<|notimestamps|>"
110
+ ],
111
+ "bos_token": {
112
+ "content": "<|endoftext|>",
113
+ "lstrip": false,
114
+ "normalized": false,
115
+ "rstrip": false,
116
+ "single_word": false
117
+ },
118
+ "eos_token": {
119
+ "content": "<|endoftext|>",
120
+ "lstrip": false,
121
+ "normalized": false,
122
+ "rstrip": false,
123
+ "single_word": false
124
+ },
125
+ "pad_token": {
126
+ "content": "<|endoftext|>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false
131
+ },
132
+ "unk_token": {
133
+ "content": "<|endoftext|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false
138
+ }
139
+ }
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff
 
vocab.json ADDED
The diff for this file is too large to render. See raw diff