Instructions to use mlx-community/gemma-2b-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/gemma-2b-coder with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/gemma-2b-coder") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use mlx-community/gemma-2b-coder with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/gemma-2b-coder" --prompt "Once upon a time"
| language: | |
| - code | |
| tags: | |
| - generated_from_trainer | |
| - code | |
| - coding | |
| - gemma | |
| - mlx | |
| datasets: | |
| - HuggingFaceH4/CodeAlpaca_20K | |
| license_name: gemma-terms-of-use | |
| license_link: https://ai.google.dev/gemma/terms | |
| thumbnail: https://huggingface.co/mrm8488/gemma-2b-coder/resolve/main/logo.png | |
| pipeline_tag: text-generation | |
| model-index: | |
| - name: gemma-2b-coder | |
| results: [] | |
| # mlx-community/gemma-2b-coder | |
| This model was converted to MLX format from [`MAISAAI/gemma-2b-coder`](). | |
| Refer to the [original model card](https://huggingface.co/MAISAAI/gemma-2b-coder) for more details on the model. | |
| ## Use with mlx | |
| ```bash | |
| pip install mlx-lm | |
| ``` | |
| ```python | |
| from mlx_lm import load, generate | |
| model, tokenizer = load("mlx-community/gemma-2b-coder") | |
| response = generate(model, tokenizer, prompt="hello", verbose=True) | |
| ``` | |