Merged
Conversation
Collaborator
|
@mm65x Looks great! If you can resolve the conflicts we can merge. |
Contributor
Author
|
rebased on main, conflicts resolved. also removed the unnecessary from_pretrained deprecation wrapper from moonshine while at it |
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
MMS (Massively Multilingual Speech) from Meta supports 1000+ languages through language-specific adapter layers on a shared wav2vec2 backbone. It fills a gap in language coverage that no other model in mlx-audio currently provides.
Description
This adds MMS ASR support by building on the existing wav2vec2 implementation. The main additions are a CTC decoding head, adapter layer support in the encoder, and automatic loading of language-specific adapter weights.
The model loads the base wav2vec2 weights from model.safetensors, then overlays language-specific adapter layers and CTC head from adapter.{lang}.safetensors. Audio is normalized to zero mean and unit variance before processing, matching the HF feature extractor behavior.
Changes in the codebase
mlx_audio/stt/models/mms/mms.py: CTC model wrapping wav2vec2, greedy CTC decoding, adapter and vocab loadingmlx_audio/stt/models/mms/tests/test_mms.py: 14 unit testsmlx_audio/stt/models/wav2vec/wav2vec.py: added Wav2Vec2AttnAdapterLayer and optional adapter support in stable layer norm encoder layersmlx_audio/stt/utils.py: register "mms" in MODEL_REMAPPINGChanges outside the codebase
None.
Additional information
Checklist