AI 領域精選文章翻譯
by Simon Willison

原文連結: Gemma 4 audio with MLX
uv run 加上 mlx_vlm 就能讓本機模型吃進 .wav 檔感謝 Rahim Nathwani 提供提示,這裡可以用一個簡單的 uv run 指令,在 macOS 上透過 10.28 GB 的 Gemma 4 E2B 模型、MLX 與 mlx-vlm 來轉錄音訊檔:
uv run --python 3.13 --with mlx_vlm --with torchvision --with gradio \
mlx_vlm.generate \
--model google/gemma-4-e2b-it \
--audio file.wav \
--prompt "Transcribe this audio" \
--max-tokens 500 \
--temperature 1.0
它拿來測試一個 14 秒的 .wav 檔時,輸出大致如下:
This front here is a quick voice memo. I want to try it out with MLX VLM. Just going to see if it can be transcribed by Gemma and how that works.
不過,原本應該是:
This right here…
… how well that works
也就是說,它大致聽懂了,但還是把幾個詞聽歪了。
Gemma 4 這類開放模型,真正值得關注的地方,不只是分數表現,而是它開始能直接嵌進開發者日常工具鏈。當模型可以在本機處理音訊、保留資料在裝置上,很多原本只能靠雲端 API 才能做的功能,就會變得更容易試,也更容易落地。
對想做離線助理、隱私優先工作流,或 Apple Silicon 本地推理的人來說,這種「小步但能跑」的範例,比空泛的 demo 更有價值。