Instructions to use google/gemma-4-12B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-12B-it with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("google/gemma-4-12B-it") model = AutoModelForImageTextToText.from_pretrained("google/gemma-4-12B-it") - Notebooks
- Google Colab
- Kaggle
fix max_position_embeddings 128Ki --> 256Ki
Browse filesThe model card and blog post both say the model supports 256Ki tokens. The config did not reflect this. This PR changes the `max_position_embeddings` in the `config.json` from 131072 to 262144.
- config.json +1 -1
config.json
CHANGED
|
@@ -106,7 +106,7 @@
|
|
| 106 |
"sliding_attention",
|
| 107 |
"full_attention"
|
| 108 |
],
|
| 109 |
-
"max_position_embeddings":
|
| 110 |
"model_type": "gemma4_unified_text",
|
| 111 |
"moe_intermediate_size": null,
|
| 112 |
"num_attention_heads": 16,
|
|
|
|
| 106 |
"sliding_attention",
|
| 107 |
"full_attention"
|
| 108 |
],
|
| 109 |
+
"max_position_embeddings": 262144,
|
| 110 |
"model_type": "gemma4_unified_text",
|
| 111 |
"moe_intermediate_size": null,
|
| 112 |
"num_attention_heads": 16,
|