---
title: gemma-2b-keras
canonical_url: "https://www.modelscope.cn/models/google/gemma-2b-keras"
md_url: "https://www.modelscope.cn/models/google/gemma-2b-keras.md"
repository: google/gemma-2b-keras
last_updated: 2025-04-22
license: gemma
pipeline_tag: text-generation
tasks:
  - text-generation
library_name:
  - pytorch
frameworks:
  - pytorch
downloads: 415
stars: 0
---

# gemma-2b-keras

> gemma-2b-keras - google 在 ModelScope 开源的模型。Google Model Page: Gemma

google/gemma-2b-keras 是 ModelScope 魔搭社区上的text-generation模型，采用 gemma 许可。

- **Repository**: google/gemma-2b-keras
- **License**: gemma
- **Tasks**: text-generation
- **Downloads**: 415
- **Stars**: 0
- **Last updated**: 2025-04-22

Source: https://www.modelscope.cn/models/google/gemma-2b-keras

---

# Gemma 1

**Google Model Page**: [Gemma](https://ai.google.dev/gemma/docs)

This model card corresponds to the latest 2B version of the Gemma model in Keras.


Keras models can be used with JAX, PyTorch or TensorFlow as numerical backends.
JAX, with its support for SPMD model paralellism, is recommended for large models.
For more information: [distributed training with Keras and JAX](https://keras.io/guides/distribution/).


You can find other models in the Gemma family here:

|    | Base                                               | Instruct                                                             |
|----|----------------------------------------------------|----------------------------------------------------------------------|
| 2B | [**gemma-2b-keras**](https://huggingface.co/google/gemma-2b-keras) | [gemma-1.1-2b-it-keras](https://huggingface.co/google/gemma-1.1-2b-it-keras) |
| 7B | [gemma-7b-keras](https://huggingface.co/google/gemma-7b-keras) | [gemma-1.1-7b-it-keras](https://huggingface.co/google/gemma-1.1-7b-it-keras)     |


For more information about the model, visit https://huggingface.co/google/gemma-2b.

**Resources and Technical Documentation**:

* [Responsible Generative AI Toolkit](https://ai.google.dev/responsible)
* [Gemma on Kaggle](https://www.kaggle.com/models/google/gemma)
* [Gemma on Vertex Model Garden](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/335?version=gemma-2b-gg-hf)

**Terms of Use**: [Terms](https://www.kaggle.com/models/google/gemma/license/consent/verify/huggingface?returnModelRepoId=google/gemma-2b-keras)

**Authors**: Google

## Loading the model

```python
import keras_nlp

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("hf://google/gemma-2b-keras")
```
