Skip to content

Update mlx-swift-lm to support Gemma 4#154

Open
mbarnach wants to merge 2 commits intohuggingface:mainfrom
mbarnach:main
Open

Update mlx-swift-lm to support Gemma 4#154
mbarnach wants to merge 2 commits intohuggingface:mainfrom
mbarnach:main

Conversation

@mbarnach
Copy link
Copy Markdown

Update the MLX-SWIFT-LM dependency to add the support for Gemma 4 model.
Not so sure about the intermediate wrapper, but open to suggestions :-)

Add HuggingFace support and a tokenizer bridge for MLX models. Imports HuggingFace and implements HubClientDownloader to fetch model snapshots via HubClient. Introduces LocalTokenizersLoader and TokenizerBridge to adapt Tokenizers.AutoTokenizer to MLXLMCommon.Tokenizer (including chat template error mapping). Update model loading calls to use the new downloader/tokenizer loader and adjust MLXTokenBackend and related APIs to use MLXLMCommon.Tokenizer and the renamed decode parameter (tokenIds). These changes enable loading models from the Hugging Face Hub and local directories with compatible tokenizer behavior.
@noorbhatia
Copy link
Copy Markdown
Contributor

@mattt pls take a look, would good to have latest changes from mlx-swift-lm. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants