mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 01:41:19 +08:00
28 lines
385 B
Markdown
28 lines
385 B
Markdown
![]() |
# whisper
|
||
|
|
||
|
Whisper in MLX.
|
||
|
|
||
|
First install the dependencies:
|
||
|
|
||
|
(TODO, MLX install link / command / add to requirements.txt)
|
||
|
|
||
|
```
|
||
|
pip install -r requirements.txt
|
||
|
```
|
||
|
|
||
|
Install [`ffmpeg`](https://ffmpeg.org/):
|
||
|
|
||
|
```bash
|
||
|
# on MacOS using Homebrew (https://brew.sh/)
|
||
|
brew install ffmpeg
|
||
|
```
|
||
|
|
||
|
Then transcribe audio with:
|
||
|
|
||
|
```
|
||
|
import whisper
|
||
|
|
||
|
text = whisper.transcribe(speech_file)["text"]
|
||
|
```
|
||
|
|