mlx-examples/whisper/README.md

33 lines
668 B
Markdown
Raw Normal View History

2023-11-30 00:17:26 +08:00
# whisper
2023-12-08 03:15:54 +08:00
Speech recognition with Whisper in MLX. Whisper is a set of open source speech
recognition models from Open AI, ranging from 39 million to 1.5 billion
parameters[^1].
2023-11-30 00:17:26 +08:00
2023-12-08 03:15:54 +08:00
### Setup
2023-11-30 00:17:26 +08:00
2023-12-08 03:15:54 +08:00
First, install the dependencies.
2023-11-30 00:17:26 +08:00
```
pip install -r requirements.txt
```
Install [`ffmpeg`](https://ffmpeg.org/):
2023-12-08 03:15:54 +08:00
```
2023-11-30 00:17:26 +08:00
# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg
```
2023-12-08 03:15:54 +08:00
### Run
Transcribe audio with:
2023-11-30 00:17:26 +08:00
```
import whisper
text = whisper.transcribe(speech_file)["text"]
```
2023-12-08 03:15:54 +08:00
[^1]: Refer to the [arXiv paper](https://arxiv.org/abs/2212.04356), [blog post](https://openai.com/research/whisper), and [code](https://github.com/openai/whisper) for more details.