Skip to content

Instantly share code, notes, and snippets.

@Olshansk
Last active December 25, 2025 23:54
Show Gist options
  • Select an option

  • Save Olshansk/888533614765cd13139515d55573d676 to your computer and use it in GitHub Desktop.

Select an option

Save Olshansk/888533614765cd13139515d55573d676 to your computer and use it in GitHub Desktop.
A bash wrapper around python's mlx_whisper to leverage the GPU on a mac for transcription
# A one liner to leverage the GPU on a mac to transcribe audio files
# Inspired by https://simonwillison.net/2024/Aug/13/mlx-whisper/
llm_transcribe_recording () {
local file_path="$1"
python3 -c "
import mlx_whisper
result = mlx_whisper.transcribe('$file_path', path_or_hf_repo='mlx-community/distil-whisper-large-v3')
print(result['text'])
"
}
@scottoreilly
Copy link
Copy Markdown

Thanks a bunch! I think there's a missing } at the end though, right?

@Olshansk
Copy link
Copy Markdown
Author

@scottoreilly Indeed. Fixed!

@scottoreilly
Copy link
Copy Markdown

Amazing. Really appreciate the simple, but super powerful script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment