Metadata-Version: 2.1
Name: whisper-mps
Version: 0.0.10
Summary: with Apple MPS support for OpenAI Whisper
Author-Email: wushuhong <wushuhong@atomgradient.com>
License: MIT
Requires-Python: >=3.10
Requires-Dist: moviepy<3.0.0,>=2.0.0
Requires-Dist: pytube>=15.0.0
Requires-Dist: mlx>=0.0.5
Requires-Dist: numba>=0.58.1
Requires-Dist: numpy>=1.26.2
Requires-Dist: torch>=2.1.1
Requires-Dist: tqdm>=4.66.1
Requires-Dist: more-itertools>=10.1.0
Requires-Dist: tiktoken>=0.3.3
Requires-Dist: rich>=13.7.0
Description-Content-Type: text/markdown

# whisper-mps

<img src="./whisper-mps.jpeg" alt="image" width="50%" height="auto">

An opinionated CLI to transcribe Audio files (or YouTube videos) w/ Whisper on-device! Powered by *MLX*, *Whisper* & *Apple M series*

**TL;DR** - After our actual testing, the Whisper supported by MPS achieves speeds comparable to a 4090!

80 mins audio file only need 80s on APPLE M1 MAX 32G! ONLY 80 SECONDS

## 🆕 Blazingly fast transcriptions via your terminal! ⚡️

We've added a CLI to enable fast transcriptions. Here's how you can use it:

Install `whisper-mps` with `pip`:

```bash
# please install ffmpeg first: brew install ffmpeg
pip install whisper-mps
```

Run inference from any path on your computer:

```bash
# filetype should be wav/mp3/mp4 etc.
whisper-mps --file-name <filename>
```

Run inference with a specific model size:

```bash
# for example, using the base model size. Other available models: "tiny", "base", "small", "medium", "large".
# Larger models require more loading time.
# filetype should be wav/mp3/mp4 etc.
whisper-mps --file-name <filename> --model-name base
```

Run inference from a YouTube URL on your computer:

> [!NOTE]
> **Deprecated:** The YouTube URL inference feature is deprecated and may be removed in future releases.  
> Please uses [yt-dlp](https://github.com/yt-dlp/yt-dlp) to download YouTube videos.

```bash
# whisper-mps --youtube-url https://www.youtube.com/watch\?v\=jaM02mb6JFM
```

> [!NOTE]
> The CLI is highly opinionated and only works on Apple MPS.

## CLI Options

The `whisper-mps` repo provides all-round support for running Whisper in various settings. More command-line support will be provided later.

```
  --file-name FILE_NAME
                  Path or URL to the audio file to be transcribed.
  --model-name MODEL_NAME
                  Size of the OPENAI Whisper model name, like tiny (default), base, small, etc.
  --youtube-url URL_ADDRESS
                  The YouTube video URL. (Deprecated)
  --output-file-name OUTPUT_FILE_NAME
                  The output file name for the transcribed text JSON.
  --log-level LOG_LEVEL
                  Optional. ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
```