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

# gemma-2b-it-flax

> gemma-2b-it-flax - google 在 ModelScope 开源的模型。[!IMPORTANT] This repository corresponds to the research Gemma repository in Jax. If you're looking for the transformers JAX implementation, visit this page.

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

- **Repository**: google/gemma-2b-it-flax
- **License**: gemma
- **Tasks**: text-generation
- **Tags**: gemma_jax
- **Downloads**: 413
- **Stars**: 0
- **Last updated**: 2025-04-22

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

---

# Gemma Model Card

> [!IMPORTANT]
>
> This repository corresponds to the research Gemma repository in Jax. If you're looking for the transformers JAX implementation, visit [this page](https://huggingface.co/google/gemma-2b-it).

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

This model card corresponds to the 2B instruct version of the Gemma model for usage with flax. For more information about the model, visit https://huggingface.co/google/gemma-2b-it.

**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-it-flax)

**Authors**: Google

## Loading the model

To download the weights and tokenizer, run:

```python
from huggingface_hub import snapshot_download

local_dir = <PATH>
snapshot_download(repo_id="google/gemma-2b-it-flax", local_dir=local_dir)
```

Then download [this script](https://github.com/google-deepmind/gemma/blob/main/examples/sampling.py) from the [gemma GitHub repository](https://github.com/google-deepmind/gemma) and call `python sampling.py` with the `--path_checkpoint` and `--path_tokenizer` arguments pointing to your local download path.
