Simon Willison’s Weblog

Subscribe

Posts tagged apple in Aug

Filters: Month: Aug × apple × Sorted by date

mlx-whisper (via) Apple's MLX framework for running GPU-accelerated machine learning models on Apple Silicon keeps growing new examples. mlx-whisper is a Python package for running OpenAI's Whisper speech-to-text model. It's really easy to use:

pip install mlx-whisper

Then in a Python console:

>>> import mlx_whisper
>>> result = mlx_whisper.transcribe(
...    "/tmp/recording.mp3",
...     path_or_hf_repo="mlx-community/distil-whisper-large-v3")
.gitattributes: 100%|███████████| 1.52k/1.52k [00:00<00:00, 4.46MB/s]
config.json: 100%|██████████████| 268/268 [00:00<00:00, 843kB/s]
README.md: 100%|████████████████| 332/332 [00:00<00:00, 1.95MB/s]
Fetching 4 files:  50%|████▌    | 2/4 [00:01<00:01,  1.26it/s]
weights.npz:  63%|██████████  ▎ | 944M/1.51G [02:41<02:15, 4.17MB/s]
>>> result.keys()
dict_keys(['text', 'segments', 'language'])
>>> result['language']
'en'
>>> len(result['text'])
100105
>>> print(result['text'][:3000])
 This is so exciting. I have to tell you, first of all ...

Here's Activity Monitor confirming that the Python process is using the GPU for the transcription:

python3.10 is using 549% CPU, 44.20 CPU time, 9 threads, 90.8% GPU, 42.53 GPU time

This example downloaded a 1.5GB model from Hugging Face and stashed it in my ~/.cache/huggingface/hub/models--mlx-community--distil-whisper-large-v3 folder.

Calling .transcribe(filepath) without the path_or_hf_repo argument uses the much smaller (74.4 MB) whisper-tiny-mlx model.

A few people asked how this compares to whisper.cpp. Bill Mill compared the two and found mlx-whisper to be about 3x faster on an M1 Max.

Update: this note from Josh Marshall:

That '3x' comparison isn't fair; completely different models. I ran a test (14" M1 Pro) with the full (non-distilled) large-v2 model quantised to 8 bit (which is my pick), and whisper.cpp was 1m vs 1m36 for mlx-whisper.

Then later:

I've now done a better test, using the MLK audio, multiple runs and 2 models (distil-large-v3, large-v2-8bit)... and mlx-whisper is indeed 30-40% faster

# 13th August 2024, 4:15 pm / apple, python, ai, openai, whisper, mlx

When we get the tools to do distributed Twitter, etc., we get the tools to communicate in stanzas richer than those allowed by our decades-old email clients. Never mind Apple being anti-competitive, social networks are the peak of monopolistic behaviour today.

Blaine Cook

# 13th August 2009, 1:06 pm / apple, blaine-cook, distributedsocialnetworks, facebook, socialnetworks, twitter

I can't question that [the App Store] is probably the best mobile application distribution method yet created, but every time I use it, a little piece of my soul dies.

Steven Frank

# 17th August 2008, 11:15 pm / apple, appstore, iphone, mobile, steven-frank

The other interesting thing about the 1.0.2 update is that Apple didn't try to prevent the hacks that are out there [...] one would have assumed that Apple would have done something in this release as a sort of "shot across the bow" but they didn't, which bodes well for a future, more open platform.

Russell Beattie

# 22nd August 2007, 10:08 pm / apple, iphone, russell-beattie, update

Django on the iPhone. Jacob got it working. The next image in his photostream shows the Django admin application querying his phone’s local database of calls.

# 19th August 2007, 7:58 am / apple, django, django-admin, iphone, jacob-kaplan-moss, python

mobileterminal (via) The iPhone now has a GUI terminal application, which can run a comand-line SSH client. Now I really want one.

# 16th August 2007, 2:54 pm / apple, iphone, jacob-kaplan-moss, mobileterminal

SproutCore (via) MVC JavaScript framework used to build the new .Mac Web Gallery application.

# 7th August 2007, 11:35 pm / ajax, apple, bill-humphries, dotmac, javascript, mvc