[PR #15560] [MERGED] gemma4: restore e2b-style nothink prompt #46453

Closed
opened 2026-04-25 01:52:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15560
Author: @drifkin
Created: 4/13/2026
Status: Merged
Merged: 4/13/2026
Merged by: @drifkin

Base: mainHead: drifkin/gemma4-no-empty-thinking


📝 Commits (1)

  • 1bbfb0c gemma4: restore e2b-style nothink prompt

📊 Changes

4 files changed (+429 additions, -47 deletions)

View changed files

📝 model/renderers/gemma4.go (+0 -3)
📝 model/renderers/gemma4_reference_test.go (+85 -44)
📝 model/renderers/testdata/gemma4_31b_chat_template.jinja2 (+0 -0)
model/renderers/testdata/gemma4_e2b_chat_template.jinja2 (+344 -0)

📄 Description

Gemma 4 prompts differ when thinking is disabled for different sized models: 26b/31b emit an empty thought block, while e2b/e4b do not.

Before #15490, our shared Gemma 4 renderer effectively matched the e2b behavior. #15490 changed it to always emit the empty thought block, which regressed e2b/e4b nothink behavior and led to #15536 (and possibly

This change restores the previous shared behavior by removing the empty trailing thought block. It also renames the checked-in upstream chat templates so the e2b and 31b fixtures are tracked separately.

A follow-up will split Gemma 4 rendering by model size.

Fixes: #15536


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15560 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 4/13/2026 **Status:** ✅ Merged **Merged:** 4/13/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/gemma4-no-empty-thinking` --- ### 📝 Commits (1) - [`1bbfb0c`](https://github.com/ollama/ollama/commit/1bbfb0c7fe62900ba67c93c796633a555a2f6a00) gemma4: restore e2b-style nothink prompt ### 📊 Changes **4 files changed** (+429 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `model/renderers/gemma4.go` (+0 -3) 📝 `model/renderers/gemma4_reference_test.go` (+85 -44) 📝 `model/renderers/testdata/gemma4_31b_chat_template.jinja2` (+0 -0) ➕ `model/renderers/testdata/gemma4_e2b_chat_template.jinja2` (+344 -0) </details> ### 📄 Description Gemma 4 prompts differ when thinking is disabled for different sized models: 26b/31b emit an empty thought block, while e2b/e4b do not. Before #15490, our shared Gemma 4 renderer effectively matched the e2b behavior. #15490 changed it to always emit the empty thought block, which regressed e2b/e4b nothink behavior and led to #15536 (and possibly This change restores the previous shared behavior by removing the empty trailing thought block. It also renames the checked-in upstream chat templates so the e2b and 31b fixtures are tracked separately. A follow-up will split Gemma 4 rendering by model size. Fixes: #15536 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 01:52:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46453