Instructions to use google/gemma-4-E2B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-E2B-it with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-E2B-it") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-E2B-it", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
Update README.md
Browse files
README.md
CHANGED
|
@@ -165,7 +165,7 @@ outputs = model.generate(**inputs, max_new_tokens=1024)
|
|
| 165 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 166 |
|
| 167 |
# Parse output
|
| 168 |
-
processor.parse_response(response)
|
| 169 |
```
|
| 170 |
|
| 171 |
To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.
|
|
@@ -226,7 +226,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 226 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 227 |
|
| 228 |
# Parse output
|
| 229 |
-
processor.parse_response(response)
|
| 230 |
```
|
| 231 |
|
| 232 |
</details>
|
|
@@ -284,7 +284,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 284 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 285 |
|
| 286 |
# Parse output
|
| 287 |
-
processor.parse_response(response)
|
| 288 |
```
|
| 289 |
|
| 290 |
</details>
|
|
@@ -343,7 +343,7 @@ outputs = model.generate(**inputs, max_new_tokens=512)
|
|
| 343 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 344 |
|
| 345 |
# Parse output
|
| 346 |
-
processor.parse_response(response)
|
| 347 |
```
|
| 348 |
|
| 349 |
</details>
|
|
|
|
| 165 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 166 |
|
| 167 |
# Parse output
|
| 168 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 169 |
```
|
| 170 |
|
| 171 |
To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.
|
|
|
|
| 226 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 227 |
|
| 228 |
# Parse output
|
| 229 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 230 |
```
|
| 231 |
|
| 232 |
</details>
|
|
|
|
| 284 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 285 |
|
| 286 |
# Parse output
|
| 287 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 288 |
```
|
| 289 |
|
| 290 |
</details>
|
|
|
|
| 343 |
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 344 |
|
| 345 |
# Parse output
|
| 346 |
+
processor.parse_response(response, prefix=inputs["input_ids"])
|
| 347 |
```
|
| 348 |
|
| 349 |
</details>
|