Skip to content

Commit

Permalink
Merge pull request #105 from kadirnar/add_mlx_library
Browse files Browse the repository at this point in the history
🍎 Add Mlx library
  • Loading branch information
kadirnar authored May 12, 2024
2 parents fa07a7e + b365d5e commit 0d6ccdd
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 0d6ccdd

Please sign in to comment.