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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-12B-it") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-12B-it", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
Raise per-image vision soft-token budget from 280 to 1120
#46
by lucianommartins - opened
- config.json +1 -1
- processor_config.json +2 -2
config.json
CHANGED
|
@@ -159,7 +159,7 @@
|
|
| 159 |
"mm_posemb_size": 1120,
|
| 160 |
"model_patch_size": 48,
|
| 161 |
"model_type": "gemma4_unified_vision",
|
| 162 |
-
"num_soft_tokens":
|
| 163 |
"output_attentions": false,
|
| 164 |
"output_hidden_states": false,
|
| 165 |
"output_proj_dims": 3840,
|
|
|
|
| 159 |
"mm_posemb_size": 1120,
|
| 160 |
"model_patch_size": 48,
|
| 161 |
"model_type": "gemma4_unified_vision",
|
| 162 |
+
"num_soft_tokens": 1120,
|
| 163 |
"output_attentions": false,
|
| 164 |
"output_hidden_states": false,
|
| 165 |
"output_proj_dims": 3840,
|
processor_config.json
CHANGED
|
@@ -26,13 +26,13 @@
|
|
| 26 |
1.0,
|
| 27 |
1.0
|
| 28 |
],
|
| 29 |
-
"max_soft_tokens":
|
| 30 |
"patch_size": 16,
|
| 31 |
"pooling_kernel_size": 3,
|
| 32 |
"resample": 3,
|
| 33 |
"rescale_factor": 0.00392156862745098
|
| 34 |
},
|
| 35 |
-
"image_seq_length":
|
| 36 |
"processor_class": "Gemma4UnifiedProcessor",
|
| 37 |
"video_processor": {
|
| 38 |
"do_convert_rgb": true,
|
|
|
|
| 26 |
1.0,
|
| 27 |
1.0
|
| 28 |
],
|
| 29 |
+
"max_soft_tokens": 1120,
|
| 30 |
"patch_size": 16,
|
| 31 |
"pooling_kernel_size": 3,
|
| 32 |
"resample": 3,
|
| 33 |
"rescale_factor": 0.00392156862745098
|
| 34 |
},
|
| 35 |
+
"image_seq_length": 1120,
|
| 36 |
"processor_class": "Gemma4UnifiedProcessor",
|
| 37 |
"video_processor": {
|
| 38 |
"do_convert_rgb": true,
|