---
title: gemma-2b-coder
canonical_url: "https://www.modelscope.cn/models/mlx-community/gemma-2b-coder"
md_url: "https://www.modelscope.cn/models/mlx-community/gemma-2b-coder.md"
repository: mlx-community/gemma-2b-coder
last_updated: 2024-12-19
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - gemma
architectures:
  - GemmaForCausalLM
parameters: 834.0M
tensor_type:
  - U32
  - F16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - code
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 2743
stars: 0
tags:
  - generated_from_trainer
  - code
  - coding
  - gemma
  - mlx
---

# gemma-2b-coder

> gemma-2b-coder - mlx-community 在 ModelScope 开源的模型。mlx-community/gemma-2b-coder This model was converted to MLX format from MAISAAI/gemma-2b-coder. Refer to the original model card for more details on the model. Use with mlx

mlx-community/gemma-2b-coder 是 ModelScope 魔搭社区上的 834.0M 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、sglang 0.5.2 部署。

- **Repository**: mlx-community/gemma-2b-coder
- **Tasks**: text-generation
- **Parameters**: 834.0M
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: generated_from_trainer, code, coding, gemma, mlx
- **Downloads**: 2743
- **Stars**: 0
- **Last updated**: 2024-12-19

Source: https://www.modelscope.cn/models/mlx-community/gemma-2b-coder

---

# 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)
```
