Skip to content

Commit

Permalink
🍎 Add Mlx library
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirnar committed May 12, 2024
1 parent fa07a7e commit b365d5e
Show file tree
Hide file tree
Showing 20 changed files with 103,584 additions and 12 deletions.
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ repos:
- id: flake8
name: Flake8 linting

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args:
- --ignore-words-list=crate,nd,strack,dota,ane,segway,fo,gool,winn
# skip inline comments
- --skip="*.py:.*#.*,*ipynb"

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## πŸ› οΈ Installation

```bash
pip install git+https://github.com/huggingface/transformers
pip install whisperplus git+https://github.com/huggingface/transformers
pip install flash-attn --no-build-isolation
```

Expand Down Expand Up @@ -74,6 +74,21 @@ transcript = pipeline(
print(transcript)
```

### Apple MLX

```python
from whisperplus.pipelines import mlx_whisper
from whisperplus import download_youtube_to_mp3

url = "https://www.youtube.com/watch?v=1__CAdTJ5JU"
audio_path = download_youtube_to_mp3(url)

text = mlx_whisper.transcribe(
audio_path, path_or_hf_repo="mlx-community/whisper-large-v3-mlx"
)["text"]
print(text)
```

### πŸ“° Summarization

```python
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions whisperplus/pipelines/mlx_whisper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright Β© 2023-2024 Apple Inc.

from . import audio, decoding, load_models
from .transcribxe import transcribe
from .version import __version__
Loading

0 comments on commit b365d5e

Please sign in to comment.