[PR #9747] [MERGED] Support multiple images in Gemma3 #44300

Closed
opened 2026-04-24 23:48:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9747
Author: @jessegross
Created: 3/13/2025
Status: Merged
Merged: 3/14/2025
Merged by: @jessegross

Base: mainHead: jessegross/multi_image


📝 Commits (3)

  • 26306ad ml: Allow models to constrain inputs to a single batch
  • e218ba4 ollamarunner: Use a separate context per multimodal input
  • 4761f15 gemma3: Allow multiple image in a single input

📊 Changes

8 files changed (+98 additions, -96 deletions)

View changed files

📝 integration/llm_image_test.go (+29 -0)
📝 model/input/input.go (+6 -0)
📝 model/model.go (+1 -1)
📝 model/models/gemma3/model.go (+9 -23)
📝 model/models/gemma3/model_text.go (+10 -43)
📝 model/models/mllama/model.go (+7 -4)
📝 runner/ollamarunner/runner.go (+35 -14)
📝 server/prompt.go (+1 -11)

📄 Description

This fixes tensor corruption that was occurring when images were getting split across batches by giving models more control over batching. With that change, it is possible to support multiple images in a single input on Gemma3.

resolves #9697


🔄 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/9747 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 3/13/2025 **Status:** ✅ Merged **Merged:** 3/14/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/multi_image` --- ### 📝 Commits (3) - [`26306ad`](https://github.com/ollama/ollama/commit/26306adf1bc8da695d9a210e662ecbbb2c955e6f) ml: Allow models to constrain inputs to a single batch - [`e218ba4`](https://github.com/ollama/ollama/commit/e218ba490d15c1bac586b2fdc8118df3a1efa2b5) ollamarunner: Use a separate context per multimodal input - [`4761f15`](https://github.com/ollama/ollama/commit/4761f150f33ba4cc6e6a4fdfe1187adfaef7aa46) gemma3: Allow multiple image in a single input ### 📊 Changes **8 files changed** (+98 additions, -96 deletions) <details> <summary>View changed files</summary> 📝 `integration/llm_image_test.go` (+29 -0) 📝 `model/input/input.go` (+6 -0) 📝 `model/model.go` (+1 -1) 📝 `model/models/gemma3/model.go` (+9 -23) 📝 `model/models/gemma3/model_text.go` (+10 -43) 📝 `model/models/mllama/model.go` (+7 -4) 📝 `runner/ollamarunner/runner.go` (+35 -14) 📝 `server/prompt.go` (+1 -11) </details> ### 📄 Description This fixes tensor corruption that was occurring when images were getting split across batches by giving models more control over batching. With that change, it is possible to support multiple images in a single input on Gemma3. resolves #9697 --- <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-24 23:48:09 -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#44300