sanchit-gandhi
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- audio
|
6 |
+
- automatic-speech-recognition
|
7 |
+
license: mit
|
8 |
+
---
|
9 |
+
|
10 |
+
# Distil-Whisper: distil-large-v3 for OpenAI Whisper
|
11 |
+
|
12 |
+
This repository contains the model weights for [distil-large-v3](https://huggingface.co/distil-whisper/distil-large-v3)
|
13 |
+
converted to [OpenAI Whisper](https://github.com/openai/whisper) format.
|
14 |
+
|
15 |
+
Compared to previous Distil-Whisper releases, distil-large-v3 is specifically designed to give one-to-one equivalence
|
16 |
+
with the OpenAI Whisper long-form transcription algorithm. In our benchmark over 4 out-of-distribution datasets, distil-large-v3
|
17 |
+
outperformed distil-large-v2 by 5% WER average. Thus, you can expect significant performance gains by switching to this
|
18 |
+
latest checkpoint.
|
19 |
+
|
20 |
+
## Usage
|
21 |
+
|
22 |
+
To use the model in the original Whisper format, first ensure you have the [`openai-whisper`](https://pypi.org/project/openai-whisper/) package installed.
|
23 |
+
For this example, we'll also install 🤗 Datasets to load a toy audio dataset from the Hugging Face Hub:
|
24 |
+
|
25 |
+
```bash
|
26 |
+
pip install --upgrade pip
|
27 |
+
pip install --upgrade openai-whisper datasets[audio]
|
28 |
+
```
|
29 |
+
|
30 |
+
The following code-snippet demonstrates how to transcribe a sample file from the LibriSpeech dataset loaded using
|
31 |
+
🤗 Datasets:
|
32 |
+
|
33 |
+
```python
|
34 |
+
from huggingface_hub import hf_hub_download
|
35 |
+
from datasets import load_dataset
|
36 |
+
from whisper import load_model, transcribe
|
37 |
+
|
38 |
+
model_path = hf_hub_download(repo_id="distil-whisper/distil-large-v3-openai", filename="model.bin")
|
39 |
+
model = load_model(model_path)
|
40 |
+
|
41 |
+
dataset = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
|
42 |
+
sample = dataset[0]["audio"]["path"]
|
43 |
+
|
44 |
+
pred_out = transcribe(model, audio=sample)
|
45 |
+
print(pred_out["text"])
|
46 |
+
```
|
47 |
+
|
48 |
+
Note that the model weights will be downloaded and saved to your cache the first time you run the example. Subsequently,
|
49 |
+
you can re-use the same example, and the weights will be loaded directly from your cache without having to download them
|
50 |
+
again.
|
51 |
+
|
52 |
+
To transcribe a local audio file, simply pass the path to the audio file as the `audio` argument to transcribe:
|
53 |
+
|
54 |
+
```python
|
55 |
+
pred_out = transcribe(model, audio="audio.mp3")
|
56 |
+
```
|
57 |
+
|
58 |
+
## Model Details
|
59 |
+
|
60 |
+
For more information about the distil-large-v3 model, refer to the original [model card](https://huggingface.co/distil-whisper/distil-large-v3).
|
61 |
+
|
62 |
+
## License
|
63 |
+
|
64 |
+
Distil-Whisper inherits the [MIT license](https://github.com/huggingface/distil-whisper/blob/main/LICENSE) from OpenAI's Whisper model.
|
65 |
+
|
66 |
+
## Citation
|
67 |
+
|
68 |
+
If you use this model, please consider citing the [Distil-Whisper paper](https://arxiv.org/abs/2311.00430):
|
69 |
+
```
|
70 |
+
@misc{gandhi2023distilwhisper,
|
71 |
+
title={Distil-Whisper: Robust Knowledge Distillation via Large-Scale Pseudo Labelling},
|
72 |
+
author={Sanchit Gandhi and Patrick von Platen and Alexander M. Rush},
|
73 |
+
year={2023},
|
74 |
+
eprint={2311.00430},
|
75 |
+
archivePrefix={arXiv},
|
76 |
+
primaryClass={cs.CL}
|
77 |
+
}
|
78 |
+
```
|