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
fix: chat_template, keep tool-call reasoning across later user turns
#49
by dimondev - opened
Summary
Same one-line fix filed on E4B/E2B: an assistant turn that called a tool loses its reasoning_content once a later user message exists, invalidating ~27% of the cached prefix on agent loops.
Patched chat_template.jinja attached.
- {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or (preserve_thinking and message.get('tool_calls')) -%}
+ {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or message.get('tool_calls') or preserve_thinking -%}
ChatLint stays at 0 errors / gate PASS (this repo already passes the error tier). The change clears a history_rewrite that was previously masked by an earlier tail_marker warning on the generation prompt, same root cause as E4B, where it surfaces as an error.
pip install chatlint
chatlint check chat_template.jinja