mlx-swift-examples
mlx-swift-examples copied to clipboard
Add support for Gemma3 models
I get the following error when loading a Gemma3 model:
unsupportedModelType("gemma3")
Yes, #238 needs to be completed first.
Hey folks! First of all, thank you for mlx-swift, it's great.
Wanted to clarify if there are any plans to support Gemma 3 in mlx-swift and maybe 3n in the nearest future?
There is a PR for it: https://github.com/ml-explore/mlx-swift-examples/pull/238. I think the model is implemented but not fully debugged. If you are interested in it, consider working with the author on this PR! We will get to it eventually but things have been busy.
I hacked together a port of Gemma3n (just the language model) here if its of any use - https://github.com/zsiegel/swift-mlx-gemma3n
I will try to pickup where the others have started and see if I can push anything forward.
I'm currently porting the Gemma3n multimodality from mlx-vlm to mlx-swift.
https://github.com/gradinnovate/mlx-swift-examples/tree/main/Libraries/MLXVLM/Models
@gradinnovate see #340 -- you might want to coordinate with @DePasqualeOrg . I think that one is stalled temporarily because the mlx-vlm side was still under development.
Go ahead and build on my draft PR or create your own, since I won't have the capacity to finish this one.
current progress....
now it works for text and image inputs. I will take some time to validate the audio part.
Were you able to do the audio part, will be pretty cool!