lesliejd ArthurZ HF staff commited on
Commit
e08502d
0 Parent(s):

Duplicate from openai/whisper-large-v2

Browse files

Co-authored-by: Arthur Zucker <ArthurZ@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - zh
5
+ - de
6
+ - es
7
+ - ru
8
+ - ko
9
+ - fr
10
+ - ja
11
+ - pt
12
+ - tr
13
+ - pl
14
+ - ca
15
+ - nl
16
+ - ar
17
+ - sv
18
+ - it
19
+ - id
20
+ - hi
21
+ - fi
22
+ - vi
23
+ - he
24
+ - uk
25
+ - el
26
+ - ms
27
+ - cs
28
+ - ro
29
+ - da
30
+ - hu
31
+ - ta
32
+ - 'no'
33
+ - th
34
+ - ur
35
+ - hr
36
+ - bg
37
+ - lt
38
+ - la
39
+ - mi
40
+ - ml
41
+ - cy
42
+ - sk
43
+ - te
44
+ - fa
45
+ - lv
46
+ - bn
47
+ - sr
48
+ - az
49
+ - sl
50
+ - kn
51
+ - et
52
+ - mk
53
+ - br
54
+ - eu
55
+ - is
56
+ - hy
57
+ - ne
58
+ - mn
59
+ - bs
60
+ - kk
61
+ - sq
62
+ - sw
63
+ - gl
64
+ - mr
65
+ - pa
66
+ - si
67
+ - km
68
+ - sn
69
+ - yo
70
+ - so
71
+ - af
72
+ - oc
73
+ - ka
74
+ - be
75
+ - tg
76
+ - sd
77
+ - gu
78
+ - am
79
+ - yi
80
+ - lo
81
+ - uz
82
+ - fo
83
+ - ht
84
+ - ps
85
+ - tk
86
+ - nn
87
+ - mt
88
+ - sa
89
+ - lb
90
+ - my
91
+ - bo
92
+ - tl
93
+ - mg
94
+ - as
95
+ - tt
96
+ - haw
97
+ - ln
98
+ - ha
99
+ - ba
100
+ - jw
101
+ - su
102
+ tags:
103
+ - audio
104
+ - automatic-speech-recognition
105
+ - hf-asr-leaderboard
106
+ widget:
107
+ - example_title: Librispeech sample 1
108
+ src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
109
+ - example_title: Librispeech sample 2
110
+ src: https://cdn-media.huggingface.co/speech_samples/sample2.flac
111
+ pipeline_tag: automatic-speech-recognition
112
+ license: apache-2.0
113
+ duplicated_from: openai/whisper-large-v2
114
+ ---
115
+
116
+ # Whisper
117
+
118
+ Whisper is a pre-trained model for automatic speech recognition (ASR) and speech translation. Trained on 680k hours
119
+ of labelled data, Whisper models demonstrate a strong ability to generalise to many datasets and domains **without** the need
120
+ for fine-tuning.
121
+
122
+ Whisper was proposed in the paper [Robust Speech Recognition via Large-Scale Weak Supervision](https://arxiv.org/abs/2212.04356)
123
+ by Alec Radford et al. from OpenAI. The original code repository can be found [here](https://github.com/openai/whisper).
124
+
125
+ Compared to the Whisper large model, the large-v2 model is trained for 2.5x more epochs with added regularization
126
+ for improved performance.
127
+
128
+ **Disclaimer**: Content for this model card has partly been written by the Hugging Face team, and parts of it were
129
+ copied and pasted from the original model card.
130
+
131
+ ## Model details
132
+
133
+ Whisper is a Transformer based encoder-decoder model, also referred to as a _sequence-to-sequence_ model.
134
+ It was trained on 680k hours of labelled speech data annotated using large-scale weak supervision.
135
+
136
+ The models were trained on either English-only data or multilingual data. The English-only models were trained
137
+ on the task of speech recognition. The multilingual models were trained on both speech recognition and speech
138
+ translation. For speech recognition, the model predicts transcriptions in the *same* language as the audio.
139
+ For speech translation, the model predicts transcriptions to a *different* language to the audio.
140
+
141
+ Whisper checkpoints come in five configurations of varying model sizes.
142
+ The smallest four are trained on either English-only or multilingual data.
143
+ The largest checkpoints are multilingual only. All ten of the pre-trained checkpoints
144
+ are available on the [Hugging Face Hub](https://huggingface.co/models?search=openai/whisper). The
145
+ checkpoints are summarised in the following table with links to the models on the Hub:
146
+
147
+ | Size | Parameters | English-only | Multilingual |
148
+ |----------|------------|------------------------------------------------------|-----------------------------------------------------|
149
+ | tiny | 39 M | [✓](https://huggingface.co/openai/whisper-tiny.en) | [✓](https://huggingface.co/openai/whisper-tiny) |
150
+ | base | 74 M | [✓](https://huggingface.co/openai/whisper-base.en) | [✓](https://huggingface.co/openai/whisper-base) |
151
+ | small | 244 M | [✓](https://huggingface.co/openai/whisper-small.en) | [✓](https://huggingface.co/openai/whisper-small) |
152
+ | medium | 769 M | [✓](https://huggingface.co/openai/whisper-medium.en) | [✓](https://huggingface.co/openai/whisper-medium) |
153
+ | large | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large) |
154
+ | large-v2 | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large-v2) |
155
+
156
+ # Usage
157
+
158
+ To transcribe audio samples, the model has to be used alongside a [`WhisperProcessor`](https://huggingface.co/docs/transformers/model_doc/whisper#transformers.WhisperProcessor).
159
+
160
+ The `WhisperProcessor` is used to:
161
+ 1. Pre-process the audio inputs (converting them to log-Mel spectrograms for the model)
162
+ 2. Post-process the model outputs (converting them from tokens to text)
163
+
164
+ The model is informed of which task to perform (transcription or translation) by passing the appropriate "context tokens". These context tokens
165
+ are a sequence of tokens that are given to the decoder at the start of the decoding process, and take the following order:
166
+ 1. The transcription always starts with the `<|startoftranscript|>` token
167
+ 2. The second token is the language token (e.g. `<|en|>` for English)
168
+ 3. The third token is the "task token". It can take one of two values: `<|transcribe|>` for speech recognition or `<|translate|>` for speech translation
169
+ 4. In addition, a `<|notimestamps|>` token is added if the model should not include timestamp prediction
170
+
171
+ Thus, a typical sequence of context tokens might look as follows:
172
+ ```
173
+ <|startoftranscript|> <|en|> <|transcribe|> <|notimestamps|>
174
+ ```
175
+ Which tells the model to decode in English, under the task of speech recognition, and not to predict timestamps.
176
+
177
+ These tokens can either be forced or un-forced. If they are forced, the model is made to predict each token at
178
+ each position. This allows one to control the output language and task for the Whisper model. If they are un-forced,
179
+ the Whisper model will automatically predict the output langauge and task itself.
180
+
181
+ The context tokens can be set accordingly:
182
+
183
+ ```python
184
+ model.config.forced_decoder_ids = WhisperProcessor.get_decoder_prompt_ids(language="english", task="transcribe")
185
+ ```
186
+
187
+ Which forces the model to predict in English under the task of speech recognition.
188
+
189
+ ## Transcription
190
+
191
+ ### English to English
192
+ In this example, the context tokens are 'unforced', meaning the model automatically predicts the output language
193
+ (English) and task (transcribe).
194
+
195
+ ```python
196
+ >>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
197
+ >>> from datasets import load_dataset
198
+
199
+ >>> # load model and processor
200
+ >>> processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
201
+ >>> model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
202
+ >>> model.config.forced_decoder_ids = None
203
+
204
+ >>> # load dummy dataset and read audio files
205
+ >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
206
+ >>> sample = ds[0]["audio"]
207
+ >>> input_features = processor(sample["array"], sampling_rate=sample["sampling_rate"], return_tensors="pt").input_features
208
+
209
+ >>> # generate token ids
210
+ >>> predicted_ids = model.generate(input_features)
211
+ >>> # decode token ids to text
212
+ >>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=False)
213
+ ['<|startoftranscript|><|en|><|transcribe|><|notimestamps|> Mr. Quilter is the apostle of the middle classes and we are glad to welcome his gospel.<|endoftext|>']
214
+
215
+ >>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
216
+ [' Mr. Quilter is the apostle of the middle classes and we are glad to welcome his gospel.']
217
+ ```
218
+ The context tokens can be removed from the start of the transcription by setting `skip_special_tokens=True`.
219
+
220
+ ### French to French
221
+ The following example demonstrates French to French transcription by setting the decoder ids appropriately.
222
+
223
+ ```python
224
+ >>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
225
+ >>> from datasets import Audio, load_dataset
226
+
227
+ >>> # load model and processor
228
+ >>> processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
229
+ >>> model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
230
+ >>> forced_decoder_ids = processor.get_decoder_prompt_ids(language="french", task="transcribe")
231
+
232
+ >>> # load streaming dataset and read first audio sample
233
+ >>> ds = load_dataset("common_voice", "fr", split="test", streaming=True)
234
+ >>> ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
235
+ >>> input_speech = next(iter(ds))["audio"]
236
+ >>> input_features = processor(input_speech["array"], sampling_rate=input_speech["sampling_rate"], return_tensors="pt").input_features
237
+
238
+ >>> # generate token ids
239
+ >>> predicted_ids = model.generate(input_features, forced_decoder_ids=forced_decoder_ids)
240
+ >>> # decode token ids to text
241
+ >>> transcription = processor.batch_decode(predicted_ids)
242
+ ['<|startoftranscript|><|fr|><|transcribe|><|notimestamps|> Un vrai travail intéressant va enfin être mené sur ce sujet.<|endoftext|>']
243
+
244
+ >>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
245
+ [' Un vrai travail intéressant va enfin être mené sur ce sujet.']
246
+ ```
247
+
248
+ ## Translation
249
+ Setting the task to "translate" forces the Whisper model to perform speech translation.
250
+
251
+ ### French to English
252
+
253
+ ```python
254
+ >>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
255
+ >>> from datasets import Audio, load_dataset
256
+
257
+ >>> # load model and processor
258
+ >>> processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
259
+ >>> model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
260
+ >>> forced_decoder_ids = processor.get_decoder_prompt_ids(language="french", task="translate")
261
+
262
+ >>> # load streaming dataset and read first audio sample
263
+ >>> ds = load_dataset("common_voice", "fr", split="test", streaming=True)
264
+ >>> ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
265
+ >>> input_speech = next(iter(ds))["audio"]
266
+ >>> input_features = processor(input_speech["array"], sampling_rate=input_speech["sampling_rate"], return_tensors="pt").input_features
267
+
268
+ >>> # generate token ids
269
+ >>> predicted_ids = model.generate(input_features, forced_decoder_ids=forced_decoder_ids)
270
+ >>> # decode token ids to text
271
+ >>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
272
+ [' A very interesting work, we will finally be given on this subject.']
273
+ ```
274
+
275
+ ## Evaluation
276
+
277
+ This code snippet shows how to evaluate Whisper Large on [LibriSpeech test-clean](https://huggingface.co/datasets/librispeech_asr):
278
+
279
+ ```python
280
+ >>> from datasets import load_dataset
281
+ >>> from transformers import WhisperForConditionalGeneration, WhisperProcessor
282
+ >>> import torch
283
+ >>> from evaluate import load
284
+
285
+ >>> librispeech_test_clean = load_dataset("librispeech_asr", "clean", split="test")
286
+
287
+ >>> processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
288
+ >>> model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2").to("cuda")
289
+
290
+ >>> def map_to_pred(batch):
291
+ >>> audio = batch["audio"]
292
+ >>> input_features = processor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_features
293
+ >>> batch["reference"] = processor.tokenizer._normalize(batch['text'])
294
+ >>>
295
+ >>> with torch.no_grad():
296
+ >>> predicted_ids = model.generate(input_features.to("cuda"))[0]
297
+ >>> transcription = processor.decode(predicted_ids)
298
+ >>> batch["prediction"] = processor.tokenizer._normalize(transcription)
299
+ >>> return batch
300
+
301
+ >>> result = librispeech_test_clean.map(map_to_pred)
302
+
303
+ >>> wer = load("wer")
304
+ >>> print(100 * wer.compute(references=result["reference"], predictions=result["prediction"]))
305
+ 3.0003583080317572
306
+ ```
307
+
308
+ ## Long-Form Transcription
309
+
310
+ The Whisper model is intrinsically designed to work on audio samples of up to 30s in duration. However, by using a chunking
311
+ algorithm, it can be used to transcribe audio samples of up to arbitrary length. This is possible through Transformers
312
+ [`pipeline`](https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.AutomaticSpeechRecognitionPipeline)
313
+ method. Chunking is enabled by setting `chunk_length_s=30` when instantiating the pipeline. It can also be extended to
314
+ predict utterance level timestamps by passing `return_timestamps=True`:
315
+
316
+ ```python
317
+ >>> import torch
318
+ >>> from transformers import pipeline
319
+ >>> from datasets import load_dataset
320
+
321
+ >>> device = "cuda:0" if torch.cuda.is_available() else "cpu"
322
+
323
+ >>> pipe = pipeline(
324
+ >>> "automatic-speech-recognition",
325
+ >>> model="openai/whisper-large-v2",
326
+ >>> chunk_length_s=30,
327
+ >>> device=device,
328
+ >>> )
329
+
330
+ >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
331
+ >>> sample = ds[0]["audio"]
332
+
333
+ >>> prediction = pipe(sample.copy())["text"]
334
+ " Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel."
335
+
336
+ >>> # we can also return timestamps for the predictions
337
+ >>> prediction = pipe(sample, return_timestamps=True)["chunks"]
338
+ [{'text': ' Mr. Quilter is the apostle of the middle classes and we are glad to welcome his gospel.',
339
+ 'timestamp': (0.0, 5.44)}]
340
+ ```
341
+
342
+ ## Fine-Tuning
343
+
344
+ The pre-trained Whisper model demonstrates a strong ability to generalise to different datasets and domains. However,
345
+ its predictive capabilities can be improved further for certain languages and tasks through *fine-tuning*. The blog
346
+ post [Fine-Tune Whisper with 🤗 Transformers](https://huggingface.co/blog/fine-tune-whisper) provides a step-by-step
347
+ guide to fine-tuning the Whisper model with as little as 5 hours of labelled data.
348
+
349
+ ### Evaluated Use
350
+
351
+ The primary intended users of these models are AI researchers studying robustness, generalization, capabilities, biases, and constraints of the current model. However, Whisper is also potentially quite useful as an ASR solution for developers, especially for English speech recognition. We recognize that once models are released, it is impossible to restrict access to only “intended” uses or to draw reasonable guidelines around what is or is not research.
352
+
353
+ The models are primarily trained and evaluated on ASR and speech translation to English tasks. They show strong ASR results in ~10 languages. They may exhibit additional capabilities, particularly if fine-tuned on certain tasks like voice activity detection, speaker classification, or speaker diarization but have not been robustly evaluated in these areas. We strongly recommend that users perform robust evaluations of the models in a particular context and domain before deploying them.
354
+
355
+ In particular, we caution against using Whisper models to transcribe recordings of individuals taken without their consent or purporting to use these models for any kind of subjective classification. We recommend against use in high-risk domains like decision-making contexts, where flaws in accuracy can lead to pronounced flaws in outcomes. The models are intended to transcribe and translate speech, use of the model for classification is not only not evaluated but also not appropriate, particularly to infer human attributes.
356
+
357
+
358
+ ## Training Data
359
+
360
+ The models are trained on 680,000 hours of audio and the corresponding transcripts collected from the internet. 65% of this data (or 438,000 hours) represents English-language audio and matched English transcripts, roughly 18% (or 126,000 hours) represents non-English audio and English transcripts, while the final 17% (or 117,000 hours) represents non-English audio and the corresponding transcript. This non-English data represents 98 different languages.
361
+
362
+ As discussed in [the accompanying paper](https://cdn.openai.com/papers/whisper.pdf), we see that performance on transcription in a given language is directly correlated with the amount of training data we employ in that language.
363
+
364
+
365
+ ## Performance and Limitations
366
+
367
+ Our studies show that, over many existing ASR systems, the models exhibit improved robustness to accents, background noise, technical language, as well as zero shot translation from multiple languages into English; and that accuracy on speech recognition and translation is near the state-of-the-art level.
368
+
369
+ However, because the models are trained in a weakly supervised manner using large-scale noisy data, the predictions may include texts that are not actually spoken in the audio input (i.e. hallucination). We hypothesize that this happens because, given their general knowledge of language, the models combine trying to predict the next word in audio with trying to transcribe the audio itself.
370
+
371
+ Our models perform unevenly across languages, and we observe lower accuracy on low-resource and/or low-discoverability languages or languages where we have less training data. The models also exhibit disparate performance on different accents and dialects of particular languages, which may include higher word error rate across speakers of different genders, races, ages, or other demographic criteria. Our full evaluation results are presented in [the paper accompanying this release](https://cdn.openai.com/papers/whisper.pdf).
372
+
373
+ In addition, the sequence-to-sequence architecture of the model makes it prone to generating repetitive texts, which can be mitigated to some degree by beam search and temperature scheduling but not perfectly. Further analysis on these limitations are provided in [the paper](https://cdn.openai.com/papers/whisper.pdf). It is likely that this behavior and hallucinations may be worse on lower-resource and/or lower-discoverability languages.
374
+
375
+
376
+ ## Broader Implications
377
+
378
+ We anticipate that Whisper models’ transcription capabilities may be used for improving accessibility tools. While Whisper models cannot be used for real-time transcription out of the box – their speed and size suggest that others may be able to build applications on top of them that allow for near-real-time speech recognition and translation. The real value of beneficial applications built on top of Whisper models suggests that the disparate performance of these models may have real economic implications.
379
+
380
+ There are also potential dual use concerns that come with releasing Whisper. While we hope the technology will be used primarily for beneficial purposes, making ASR technology more accessible could enable more actors to build capable surveillance technologies or scale up existing surveillance efforts, as the speed and accuracy allow for affordable automatic transcription and translation of large volumes of audio communication. Moreover, these models may have some capabilities to recognize specific individuals out of the box, which in turn presents safety concerns related both to dual use and disparate performance. In practice, we expect that the cost of transcription is not the limiting factor of scaling up surveillance projects.
381
+
382
+
383
+ ### BibTeX entry and citation info
384
+ ```bibtex
385
+ @misc{radford2022whisper,
386
+ doi = {10.48550/ARXIV.2212.04356},
387
+ url = {https://arxiv.org/abs/2212.04356},
388
+ author = {Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
389
+ title = {Robust Speech Recognition via Large-Scale Weak Supervision},
390
+ publisher = {arXiv},
391
+ year = {2022},
392
+ copyright = {arXiv.org perpetual, non-exclusive license}
393
+ }
394
+ ```
added_tokens.json ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|af|>": 50327,
3
+ "<|am|>": 50334,
4
+ "<|ar|>": 50272,
5
+ "<|as|>": 50350,
6
+ "<|az|>": 50304,
7
+ "<|ba|>": 50355,
8
+ "<|be|>": 50330,
9
+ "<|bg|>": 50292,
10
+ "<|bn|>": 50302,
11
+ "<|bo|>": 50347,
12
+ "<|br|>": 50309,
13
+ "<|bs|>": 50315,
14
+ "<|ca|>": 50270,
15
+ "<|cs|>": 50283,
16
+ "<|cy|>": 50297,
17
+ "<|da|>": 50285,
18
+ "<|de|>": 50261,
19
+ "<|el|>": 50281,
20
+ "<|en|>": 50259,
21
+ "<|es|>": 50262,
22
+ "<|et|>": 50307,
23
+ "<|eu|>": 50310,
24
+ "<|fa|>": 50300,
25
+ "<|fi|>": 50277,
26
+ "<|fo|>": 50338,
27
+ "<|fr|>": 50265,
28
+ "<|gl|>": 50319,
29
+ "<|gu|>": 50333,
30
+ "<|haw|>": 50352,
31
+ "<|ha|>": 50354,
32
+ "<|he|>": 50279,
33
+ "<|hi|>": 50276,
34
+ "<|hr|>": 50291,
35
+ "<|ht|>": 50339,
36
+ "<|hu|>": 50286,
37
+ "<|hy|>": 50312,
38
+ "<|id|>": 50275,
39
+ "<|is|>": 50311,
40
+ "<|it|>": 50274,
41
+ "<|ja|>": 50266,
42
+ "<|jw|>": 50356,
43
+ "<|ka|>": 50329,
44
+ "<|kk|>": 50316,
45
+ "<|km|>": 50323,
46
+ "<|kn|>": 50306,
47
+ "<|ko|>": 50264,
48
+ "<|la|>": 50294,
49
+ "<|lb|>": 50345,
50
+ "<|ln|>": 50353,
51
+ "<|lo|>": 50336,
52
+ "<|lt|>": 50293,
53
+ "<|lv|>": 50301,
54
+ "<|mg|>": 50349,
55
+ "<|mi|>": 50295,
56
+ "<|mk|>": 50308,
57
+ "<|ml|>": 50296,
58
+ "<|mn|>": 50314,
59
+ "<|mr|>": 50320,
60
+ "<|ms|>": 50282,
61
+ "<|mt|>": 50343,
62
+ "<|my|>": 50346,
63
+ "<|ne|>": 50313,
64
+ "<|nl|>": 50271,
65
+ "<|nn|>": 50342,
66
+ "<|nocaptions|>": 50362,
67
+ "<|notimestamps|>": 50363,
68
+ "<|no|>": 50288,
69
+ "<|oc|>": 50328,
70
+ "<|pa|>": 50321,
71
+ "<|pl|>": 50269,
72
+ "<|ps|>": 50340,
73
+ "<|pt|>": 50267,
74
+ "<|ro|>": 50284,
75
+ "<|ru|>": 50263,
76
+ "<|sa|>": 50344,
77
+ "<|sd|>": 50332,
78
+ "<|si|>": 50322,
79
+ "<|sk|>": 50298,
80
+ "<|sl|>": 50305,
81
+ "<|sn|>": 50324,
82
+ "<|so|>": 50326,
83
+ "<|sq|>": 50317,
84
+ "<|sr|>": 50303,
85
+ "<|startoflm|>": 50360,
86
+ "<|startofprev|>": 50361,
87
+ "<|startoftranscript|>": 50258,
88
+ "<|su|>": 50357,
89
+ "<|sv|>": 50273,
90
+ "<|sw|>": 50318,
91
+ "<|ta|>": 50287,
92
+ "<|te|>": 50299,
93
+ "<|tg|>": 50331,
94
+ "<|th|>": 50289,
95
+ "<|tk|>": 50341,
96
+ "<|tl|>": 50348,
97
+ "<|transcribe|>": 50359,
98
+ "<|translate|>": 50358,
99
+ "<|tr|>": 50268,
100
+ "<|tt|>": 50351,
101
+ "<|uk|>": 50280,
102
+ "<|ur|>": 50290,
103
+ "<|uz|>": 50337,
104
+ "<|vi|>": 50278,
105
+ "<|yi|>": 50335,
106
+ "<|yo|>": 50325,
107
+ "<|zh|>": 50260
108
+ }
config.json ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai/whisper-large-v2",
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "architectures": [
6
+ "WhisperForConditionalGeneration"
7
+ ],
8
+ "attention_dropout": 0.0,
9
+ "begin_suppress_tokens": [
10
+ 220,
11
+ 50257
12
+ ],
13
+ "bos_token_id": 50257,
14
+ "d_model": 1280,
15
+ "decoder_attention_heads": 20,
16
+ "decoder_ffn_dim": 5120,
17
+ "decoder_layerdrop": 0.0,
18
+ "decoder_layers": 32,
19
+ "decoder_start_token_id": 50258,
20
+ "dropout": 0.0,
21
+ "encoder_attention_heads": 20,
22
+ "encoder_ffn_dim": 5120,
23
+ "encoder_layerdrop": 0.0,
24
+ "encoder_layers": 32,
25
+ "eos_token_id": 50257,
26
+ "forced_decoder_ids": [
27
+ [
28
+ 1,
29
+ 50259
30
+ ],
31
+ [
32
+ 2,
33
+ 50359
34
+ ],
35
+ [
36
+ 3,
37
+ 50363
38
+ ]
39
+ ],
40
+ "init_std": 0.02,
41
+ "is_encoder_decoder": true,
42
+ "max_length": 448,
43
+ "max_source_positions": 1500,
44
+ "max_target_positions": 448,
45
+ "model_type": "whisper",
46
+ "num_hidden_layers": 32,
47
+ "num_mel_bins": 80,
48
+ "pad_token_id": 50257,
49
+ "scale_embedding": false,
50
+ "suppress_tokens": [
51
+ 1,
52
+ 2,
53
+ 7,
54
+ 8,
55
+ 9,
56
+ 10,
57
+ 14,
58
+ 25,
59
+ 26,
60
+ 27,
61
+ 28,
62
+ 29,
63
+ 31,
64
+ 58,
65
+ 59,
66
+ 60,
67
+ 61,
68
+ 62,
69
+ 63,
70
+ 90,
71
+ 91,
72
+ 92,
73
+ 93,
74
+ 359,
75
+ 503,
76
+ 522,
77
+ 542,
78
+ 873,
79
+ 893,
80
+ 902,
81
+ 918,
82
+ 922,
83
+ 931,
84
+ 1350,
85
+ 1853,
86
+ 1982,
87
+ 2460,
88
+ 2627,
89
+ 3246,
90
+ 3253,
91
+ 3268,
92
+ 3536,
93
+ 3846,
94
+ 3961,
95
+ 4183,
96
+ 4667,
97
+ 6585,
98
+ 6647,
99
+ 7273,
100
+ 9061,
101
+ 9383,
102
+ 10428,
103
+ 10929,
104
+ 11938,
105
+ 12033,
106
+ 12331,
107
+ 12562,
108
+ 13793,
109
+ 14157,
110
+ 14635,
111
+ 15265,
112
+ 15618,
113
+ 16553,
114
+ 16604,
115
+ 18362,
116
+ 18956,
117
+ 20075,
118
+ 21675,
119
+ 22520,
120
+ 26130,
121
+ 26161,
122
+ 26435,
123
+ 28279,
124
+ 29464,
125
+ 31650,
126
+ 32302,
127
+ 32470,
128
+ 36865,
129
+ 42863,
130
+ 47425,
131
+ 49870,
132
+ 50254,
133
+ 50258,
134
+ 50360,
135
+ 50361,
136
+ 50362
137
+ ],
138
+ "torch_dtype": "float32",
139
+ "transformers_version": "4.27.0.dev0",
140
+ "use_cache": true,
141
+ "vocab_size": 51865
142
+ }
flax_model.msgpack ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:232ca989cd2bc0830e0edf975e0475cdb3fea944c9eb9b56d923189adf19f8e3
3
+ size 6173264923
generation_config.json ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "begin_suppress_tokens": [
3
+ 220,
4
+ 50257
5
+ ],
6
+ "bos_token_id": 50257,
7
+ "decoder_start_token_id": 50258,
8
+ "eos_token_id": 50257,
9
+ "forced_decoder_ids": [
10
+ [
11
+ 1,
12
+ null
13
+ ],
14
+ [
15
+ 2,
16
+ 50359
17
+ ]
18
+ ],
19
+ "is_multilingual": true,
20
+ "lang_to_id": {
21
+ "<|af|>": 50327,
22
+ "<|am|>": 50334,
23
+ "<|ar|>": 50272,
24
+ "<|as|>": 50350,
25
+ "<|az|>": 50304,
26
+ "<|ba|>": 50355,
27
+ "<|be|>": 50330,
28
+ "<|bg|>": 50292,
29
+ "<|bn|>": 50302,
30
+ "<|bo|>": 50347,
31
+ "<|br|>": 50309,
32
+ "<|bs|>": 50315,
33
+ "<|ca|>": 50270,
34
+ "<|cs|>": 50283,
35
+ "<|cy|>": 50297,
36
+ "<|da|>": 50285,
37
+ "<|de|>": 50261,
38
+ "<|el|>": 50281,
39
+ "<|en|>": 50259,
40
+ "<|es|>": 50262,
41
+ "<|et|>": 50307,
42
+ "<|eu|>": 50310,
43
+ "<|fa|>": 50300,
44
+ "<|fi|>": 50277,
45
+ "<|fo|>": 50338,
46
+ "<|fr|>": 50265,
47
+ "<|gl|>": 50319,
48
+ "<|gu|>": 50333,
49
+ "<|haw|>": 50352,
50
+ "<|ha|>": 50354,
51
+ "<|he|>": 50279,
52
+ "<|hi|>": 50276,
53
+ "<|hr|>": 50291,
54
+ "<|ht|>": 50339,
55
+ "<|hu|>": 50286,
56
+ "<|hy|>": 50312,
57
+ "<|id|>": 50275,
58
+ "<|is|>": 50311,
59
+ "<|it|>": 50274,
60
+ "<|ja|>": 50266,
61
+ "<|jw|>": 50356,
62
+ "<|ka|>": 50329,
63
+ "<|kk|>": 50316,
64
+ "<|km|>": 50323,
65
+ "<|kn|>": 50306,
66
+ "<|ko|>": 50264,
67
+ "<|la|>": 50294,
68
+ "<|lb|>": 50345,
69
+ "<|ln|>": 50353,
70
+ "<|lo|>": 50336,
71
+ "<|lt|>": 50293,
72
+ "<|lv|>": 50301,
73
+ "<|mg|>": 50349,
74
+ "<|mi|>": 50295,
75
+ "<|mk|>": 50308,
76
+ "<|ml|>": 50296,
77
+ "<|mn|>": 50314,
78
+ "<|mr|>": 50320,
79
+ "<|ms|>": 50282,
80
+ "<|mt|>": 50343,
81
+ "<|my|>": 50346,
82
+ "<|ne|>": 50313,
83
+ "<|nl|>": 50271,
84
+ "<|nn|>": 50342,
85
+ "<|no|>": 50288,
86
+ "<|oc|>": 50328,
87
+ "<|pa|>": 50321,
88
+ "<|pl|>": 50269,
89
+ "<|ps|>": 50340,
90
+ "<|pt|>": 50267,
91
+ "<|ro|>": 50284,
92
+ "<|ru|>": 50263,
93
+ "<|sa|>": 50344,
94
+ "<|sd|>": 50332,
95
+ "<|si|>": 50322,
96
+ "<|sk|>": 50298,
97
+ "<|sl|>": 50305,
98
+ "<|sn|>": 50324,
99
+ "<|so|>": 50326,
100
+ "<|sq|>": 50317,
101
+ "<|sr|>": 50303,
102
+ "<|su|>": 50357,
103
+ "<|sv|>": 50273,
104
+ "<|sw|>": 50318,
105
+ "<|ta|>": 50287,
106
+ "<|te|>": 50299,
107
+ "<|tg|>": 50331,
108
+ "<|th|>": 50289,
109
+ "<|tk|>": 50341,
110
+ "<|tl|>": 50348,
111
+ "<|tr|>": 50268,
112
+ "<|tt|>": 50351,
113
+ "<|uk|>": 50280,
114
+ "<|ur|>": 50290,
115
+ "<|uz|>": 50337,
116
+ "<|vi|>": 50278,
117
+ "<|yi|>": 50335,
118
+ "<|yo|>": 50325,
119
+ "<|zh|>": 50260
120
+ },
121
+ "max_initial_timestamp_index": 1,
122
+ "max_length": 448,
123
+ "no_timestamps_token_id": 50363,
124
+ "pad_token_id": 50257,
125
+ "return_timestamps": false,
126
+ "suppress_tokens": [
127
+ 1,
128
+ 2,
129
+ 7,
130
+ 8,
131
+ 9,
132
+ 10,
133
+ 14,
134
+ 25,
135
+ 26,
136
+ 27,
137
+ 28,
138
+ 29,
139
+ 31,
140
+ 58,
141
+ 59,
142
+ 60,
143
+ 61,
144
+ 62,
145
+ 63,
146
+ 90,
147
+ 91,
148
+ 92,
149
+ 93,
150
+ 359,
151
+ 503,
152
+ 522,
153
+ 542,
154
+ 873,
155
+ 893,
156
+ 902,
157
+ 918,
158
+ 922,
159
+ 931,
160
+ 1350,
161
+ 1853,
162
+ 1982,
163
+ 2460,
164
+ 2627,
165
+ 3246,
166
+ 3253,
167
+ 3268,
168
+ 3536,
169
+ 3846,
170
+ 3961,
171
+ 4183,
172
+ 4667,
173
+ 6585,
174
+ 6647,
175
+ 7273,
176
+ 9061,
177
+ 9383,
178
+ 10428,
179
+ 10929,
180
+ 11938,
181
+ 12033,
182
+ 12331,
183
+ 12562,
184
+ 13793,
185
+ 14157,
186
+ 14635,
187
+ 15265,
188
+ 15618,
189
+ 16553,
190
+ 16604,
191
+ 18362,
192
+ 18956,
193
+ 20075,
194
+ 21675,
195
+ 22520,
196
+ 26130,
197
+ 26161,
198
+ 26435,
199
+ 28279,
200
+ 29464,
201
+ 31650,
202
+ 32302,
203
+ 32470,
204
+ 36865,
205
+ 42863,
206
+ 47425,
207
+ 49870,
208
+ 50254,
209
+ 50258,
210
+ 50360,
211
+ 50361,
212
+ 50362
213
+ ],
214
+ "task_to_id": {
215
+ "transcribe": 50359,
216
+ "translate": 50358
217
+ },
218
+ "transformers_version": "4.27.0.dev0"
219
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
normalizer.json ADDED
@@ -0,0 +1,1742 @@