Instructions to use google/gemma-4-E2B-it-qat-q4_0-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-E2B-it-qat-q4_0-unquantized with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-E2B-it-qat-q4_0-unquantized") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-E2B-it-qat-q4_0-unquantized", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse filesUpdate `parse_response` example code to the new API (pass `prefix=inputs["input_ids"]`), matching the base model PRs.
README.md
CHANGED
|
@@ -180,7 +180,7 @@ outputs = model.generate(**inputs, max_new_tokens=1024)
|
|
| 180 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 181 |
|
| 182 |
# Parse output
|
| 183 |
-
processor.parse_response(response)
|
| 184 |
```
|
| 185 |
|
| 186 |
To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.
|
|
@@ -240,7 +240,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 240 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 241 |
|
| 242 |
# Parse output
|
| 243 |
-
processor.parse_response(response)
|
| 244 |
```
|
| 245 |
|
| 246 |
</details>
|
|
@@ -298,7 +298,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 298 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 299 |
|
| 300 |
# Parse output
|
| 301 |
-
processor.parse_response(response)
|
| 302 |
```
|
| 303 |
|
| 304 |
</details>
|
|
@@ -357,7 +357,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 357 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 358 |
|
| 359 |
# Parse output
|
| 360 |
-
processor.parse_response(response)
|
| 361 |
```
|
| 362 |
|
| 363 |
</details>
|
|
|
|
| 180 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 181 |
|
| 182 |
# Parse output
|
| 183 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 184 |
```
|
| 185 |
|
| 186 |
To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.
|
|
|
|
| 240 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 241 |
|
| 242 |
# Parse output
|
| 243 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 244 |
```
|
| 245 |
|
| 246 |
</details>
|
|
|
|
| 298 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 299 |
|
| 300 |
# Parse output
|
| 301 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 302 |
```
|
| 303 |
|
| 304 |
</details>
|
|
|
|
| 357 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 358 |
|
| 359 |
# Parse output
|
| 360 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 361 |
```
|
| 362 |
|
| 363 |
</details>
|