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") - Notebooks
- Google Colab
- Kaggle
Fix chat template turn closure after tool-call-only turns
Browse files- chat_template.jinja +1 -1
chat_template.jinja
CHANGED
|
@@ -369,7 +369,7 @@
|
|
| 369 |
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 370 |
{{- '<|tool_response>' -}}
|
| 371 |
{%- elif continues_into_next -%}
|
| 372 |
-
{%- elif not (ns_tr_out.flag and not has_content) -%}
|
| 373 |
{{- '<turn|>\n' -}}
|
| 374 |
{%- endif -%}
|
| 375 |
|
|
|
|
| 369 |
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 370 |
{{- '<|tool_response>' -}}
|
| 371 |
{%- elif continues_into_next -%}
|
| 372 |
+
{%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
|
| 373 |
{{- '<turn|>\n' -}}
|
| 374 |
{%- endif -%}
|
| 375 |
|