Whisper: Support command line (#746)

* Whisper: Add CLI command

* Whisper: Prevent precision loss when converting to words dictionary

* Whisper: disable json ensure_ascii

* Whisper: add cli setup config

* Whisper: pre-commit

* Whisper: Adjust the _ in the command line arguments to -

* nits

* version + readme

* nit

---------

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
madroid
2024-08-17 01:35:44 +08:00
committed by GitHub
parent 4e01700816
commit e196fa3208
6 changed files with 531 additions and 2 deletions

View File

@@ -21,6 +21,22 @@ pip install mlx-whisper
### Run
#### CLI
At its simplest:
```
mlx_whisper audio_file.mp3
```
This will make a text file `audio_file.txt` with the results.
Use `-f` to specify the output format and `--model` to specify the model. There
are many other supported command line options. To see them all, run
`mlx_whisper -h`.
#### API
Transcribe audio with:
```python