Merged
Conversation
lucasnewman
reviewed
Mar 8, 2026
| return model | ||
|
|
||
| @classmethod | ||
| def from_pretrained(cls, path_or_repo: str, *, dtype: mx.Dtype = mx.float32): |
Collaborator
There was a problem hiding this comment.
I don't think we need a deprecation warning here since it's new -- either leave it out or remove the warning if you want to keep it.
lucasnewman
requested changes
Mar 8, 2026
Collaborator
lucasnewman
left a comment
There was a problem hiding this comment.
@mm65x This is really well done, thanks! Can you please run the formatter: pre-commit run --all to clear tests and see the comment? Then we can merge.
Contributor
Author
|
done, ran the formatter |
Collaborator
|
@mm65x Looks like a merge conflict from your other PR, if you can fix it up I'll merge. |
Contributor
Author
|
rebased on main, conflict resolved |
lucasnewman
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Moonshine is a lightweight ASR model from Useful Sensors (https://github.com/usefulsensors/moonshine), comparable accuracy to Whisper but much smaller (27M tiny, 61M base). It processes raw audio through a learned conv frontend rather than mel spectrograms, so it runs efficiently on Apple Silicon.
Description
This adds Moonshine to the STT pipeline. The implementation is based on the HuggingFace transformers reference and loads safetensors weights from the hub.
The encoder has a 3 layer conv frontend feeding into transformer layers with RoPE. The decoder uses cross attention and SwiGLU. Both tiny and base variants are supported through config.
Changes in the codebase
mlx_audio/stt/models/moonshine/moonshine.py: model with encoder (conv frontend + transformer), decoder (cross attention + SwiGLU), RoPE, generate(), sanitize()mlx_audio/stt/models/moonshine/config.py: config matching HF defaultsmlx_audio/stt/models/moonshine/tests/test_moonshine.py: 25 unit testsmlx_audio/stt/utils.py: register "moonshine" in MODEL_REMAPPINGChanges outside the codebase
None.
Additional information
Checklist