zwan074 commited on
Commit
587b198
1 Parent(s): c17c9d9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -124
README.md CHANGED
@@ -112,54 +112,6 @@ pipeline_tag: automatic-speech-recognition
112
  license: apache-2.0
113
  ---
114
 
115
- # Whisper
116
-
117
- Whisper is a pre-trained model for automatic speech recognition (ASR) and speech translation. Trained on 680k hours
118
- of labelled data, Whisper models demonstrate a strong ability to generalise to many datasets and domains **without** the need
119
- for fine-tuning.
120
-
121
- Whisper was proposed in the paper [Robust Speech Recognition via Large-Scale Weak Supervision](https://arxiv.org/abs/2212.04356)
122
- by Alec Radford et al. from OpenAI. The original code repository can be found [here](https://github.com/openai/whisper).
123
-
124
- Whisper `large-v3` has the same architecture as the previous large models except the following minor differences:
125
-
126
- 1. The input uses 128 Mel frequency bins instead of 80
127
- 2. A new language token for Cantonese
128
-
129
- The Whisper `large-v3` model is trained on 1 million hours of weakly labeled audio and 4 million hours of pseudolabeled audio collected using Whisper `large-v2`.
130
- The model was trained for 2.0 epochs over this mixture dataset.
131
-
132
- The `large-v3` model shows improved performance over a wide variety of languages, showing 10% to 20% reduction of errors compared to Whisper `large-v2`.
133
-
134
-
135
- **Disclaimer**: Content for this model card has partly been written by the Hugging Face team, and parts of it were
136
- copied and pasted from the original model card.
137
-
138
- ## Model details
139
-
140
- Whisper is a Transformer based encoder-decoder model, also referred to as a _sequence-to-sequence_ model.
141
- It was trained on 1 million hours of weakly labeled audio and 4 million hours of pseudolabeled audio collected using Whisper `large-v2`.
142
-
143
- The models were trained on either English-only data or multilingual data. The English-only models were trained
144
- on the task of speech recognition. The multilingual models were trained on both speech recognition and speech
145
- translation. For speech recognition, the model predicts transcriptions in the *same* language as the audio.
146
- For speech translation, the model predicts transcriptions to a *different* language to the audio.
147
-
148
- Whisper checkpoints come in five configurations of varying model sizes.
149
- The smallest four are trained on either English-only or multilingual data.
150
- The largest checkpoints are multilingual only. All ten of the pre-trained checkpoints
151
- are available on the [Hugging Face Hub](https://huggingface.co/models?search=openai/whisper). The
152
- checkpoints are summarised in the following table with links to the models on the Hub:
153
-
154
- | Size | Parameters | English-only | Multilingual |
155
- |----------|------------|------------------------------------------------------|-----------------------------------------------------|
156
- | tiny | 39 M | [✓](https://huggingface.co/openai/whisper-tiny.en) | [✓](https://huggingface.co/openai/whisper-tiny) |
157
- | base | 74 M | [✓](https://huggingface.co/openai/whisper-base.en) | [✓](https://huggingface.co/openai/whisper-base) |
158
- | small | 244 M | [✓](https://huggingface.co/openai/whisper-small.en) | [✓](https://huggingface.co/openai/whisper-small) |
159
- | medium | 769 M | [✓](https://huggingface.co/openai/whisper-medium.en) | [✓](https://huggingface.co/openai/whisper-medium) |
160
- | large | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large) |
161
- | large-v2 | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large-v2) |
162
- | large-v3 | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large-v3) |
163
 
164
  ## Usage
165
 
@@ -229,80 +181,4 @@ result = pipe(sample, generate_kwargs={"language": "maori"})
229
 
230
 
231
 
232
- ## Additional Speed & Memory Improvements
233
-
234
- You can apply additional speed and memory improvements to Whisper-large-v3 which we cover in the following.
235
-
236
- ### Flash Attention
237
-
238
- We recommend using [Flash-Attention 2](https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#flashattention-2) if your GPU allows for it.
239
- To do so, you first need to install [Flash Attention](https://github.com/Dao-AILab/flash-attention):
240
-
241
- ```
242
- pip install flash-attn --no-build-isolation
243
- ```
244
-
245
- and then all you have to do is to pass `use_flash_attention_2=True` to `from_pretrained`:
246
-
247
- ```diff
248
- - model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True)
249
- + model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True, use_flash_attention_2=True)
250
- ```
251
-
252
- ### Torch Scale-Product-Attention (SDPA)
253
-
254
- If your GPU does not support Flash Attention, we recommend making use of [BetterTransformers](https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#bettertransformer).
255
- To do so, you first need to install optimum:
256
-
257
- ```
258
- pip install --upgrade optimum
259
- ```
260
-
261
- And then convert your model to a "BetterTransformer" model before using it:
262
-
263
- ```diff
264
- model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True)
265
- + model = model.to_bettertransformer()
266
- ```
267
-
268
- ## Fine-Tuning
269
-
270
- The pre-trained Whisper model demonstrates a strong ability to generalise to different datasets and domains. However,
271
- its predictive capabilities can be improved further for certain languages and tasks through *fine-tuning*. The blog
272
- post [Fine-Tune Whisper with 🤗 Transformers](https://huggingface.co/blog/fine-tune-whisper) provides a step-by-step
273
- guide to fine-tuning the Whisper model with as little as 5 hours of labelled data.
274
-
275
- ### Evaluated Use
276
-
277
- 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.
278
-
279
- 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.
280
-
281
- 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.
282
-
283
-
284
- ## Training Data
285
-
286
- The models are trained on 1 million hours of weakly labeled audio and 4 million hours of pseudolabeled audio collected using Whisper `large-v2`.
287
-
288
- 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.
289
-
290
-
291
- ## Performance and Limitations
292
-
293
- 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.
294
-
295
- 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.
296
-
297
- 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).
298
-
299
- 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.
300
-
301
-
302
- ## Broader Implications
303
-
304
- 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.
305
-
306
- 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.
307
-
308
 
 
112
  license: apache-2.0
113
  ---
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  ## Usage
117
 
 
181
 
182
 
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184