Downloads · 30 days
10
6% of all-time downloads
zeromodels/gemma-2-9b-it
gemma-2-9b-it is a text generation model from zeromodels. Use it when you need the model to write or continue text. It is set up for zeromodels. The card lists the license as gemma.
See our collection for all Gemma 2 sizes and variants.
Downloads · 30 days
10
6% of all-time downloads
All-time downloads
162
Public
Repo size
18.5 GB
Likes
0
Public
Click a slice to open those files.
.h518.5 GB · 100%
From the Hugging Face model README
See our collection for all Gemma 2 sizes and variants.
Pure-Keras 3 conversion of google/gemma-2-9b-it for
zeromodels. One implementation runs unmodified on
TensorFlow / Torch / JAX. This is the instruction-tuned checkpoint, served here as text -> text via Gemma2TextGenerate; weights are
stored in bfloat16.
For model details, license, and usage terms, see Google's model card.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.gemma2 import Gemma2TextGenerate, Gemma2Tokenizer
model = Gemma2TextGenerate.from_weights("zeromodels/gemma-2-9b-it")
tokenizer = Gemma2Tokenizer.from_weights("zeromodels/gemma-2-9b-it")
inputs = tokenizer([{"role": "user", "content": "Hello, who are you?"}])
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0]))
Load any Gemma 2 variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub |
|---|---|
gemma-2-27b | zeromodels/gemma-2-27b |
gemma-2-27b-it | zeromodels/gemma-2-27b-it |
gemma-2-2b | zeromodels/gemma-2-2b |
gemma-2-2b-it | zeromodels/gemma-2-2b-it |
gemma-2-9b | zeromodels/gemma-2-9b |
gemma-2-9b-it | zeromodels/gemma-2-9b-it |
KERAS_BACKEND before importing Keras / zeromodels.load_dtype="float32" for full precision,
or quantization="int8" to shrink further.hf: prefix:
Gemma2TextGenerate.from_weights("hf:google/gemma-2-9b-it").A huge thank you to the Google Gemma authors for creating and releasing these models.
License: Gemma (gated). Accept the license on the upstream Hub card before downloading.