Commit
•
0ab491c
1
Parent(s):
dcbf704
whisper cpp
Browse files
README.md
CHANGED
@@ -263,6 +263,40 @@ To transcribe a local audio file, simply pass the path to the audio file as the
|
|
263 |
pred_out = transcribe(model, audio="audio.mp3")
|
264 |
```
|
265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
### Transformers.js
|
267 |
|
268 |
```js
|
|
|
263 |
pred_out = transcribe(model, audio="audio.mp3")
|
264 |
```
|
265 |
|
266 |
+
### Whisper.cpp
|
267 |
+
|
268 |
+
Distil-Whisper can be run from the [Whisper.cpp](https://github.com/ggerganov/whisper.cpp) repository with the original
|
269 |
+
sequential long-form transcription algorithm. In a [provisional benchmark](https://github.com/ggerganov/whisper.cpp/pull/1424#issuecomment-1793513399)
|
270 |
+
on Mac M1, `distil-large-v2` is 2x faster than `large-v2`, while performing to within 0.1% WER over long-form audio.
|
271 |
+
|
272 |
+
Note that future releases of Distil-Whisper will target faster CPU inference more! By distilling smaller encoders, we
|
273 |
+
aim to achieve similar speed-ups to what we obtain on GPU.
|
274 |
+
|
275 |
+
Steps for getting started:
|
276 |
+
1. Clone the Whisper.cpp repository:
|
277 |
+
```
|
278 |
+
git clone https://github.com/ggerganov/whisper.cpp.git
|
279 |
+
cd whisper.cpp
|
280 |
+
```
|
281 |
+
2. Download the ggml weights for `distil-medium.en` from the Hugging Face Hub:
|
282 |
+
|
283 |
+
```bash
|
284 |
+
python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='distil-whisper/distil-large-v2', filename='ggml-large-32-2.en.bin', local_dir='./models')"
|
285 |
+
```
|
286 |
+
|
287 |
+
Note that if you do not have the `huggingface_hub` package installed, you can also download the weights with `wget`:
|
288 |
+
|
289 |
+
```bash
|
290 |
+
wget https://huggingface.co/distil-whisper/distil-large-v2/resolve/main/ggml-large-32-2.en.bin -P ./models
|
291 |
+
```
|
292 |
+
|
293 |
+
3. Run inference using the provided sample audio:
|
294 |
+
|
295 |
+
```bash
|
296 |
+
make -j && ./main -m models/ggml-large-32-2.en.bin -f samples/jfk.wav
|
297 |
+
```
|
298 |
+
|
299 |
+
|
300 |
### Transformers.js
|
301 |
|
302 |
```js
|