[PR #7849] [MERGED] runner.go: Don't try to extract image tags for text models #12536

Closed
opened 2026-04-13 00:02:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/7849
Author: @jessegross
Created: 11/26/2024
Status: Merged
Merged: 11/26/2024
Merged by: @jessegross

Base: mainHead: jessegross/embed


📝 Commits (1)

  • 459d689 runner.go: Don't try to extract image tags for text models

📊 Changes

1 file changed (+9 additions, -3 deletions)

View changed files

📝 llama/runner/runner.go (+9 -3)

📄 Description

When processing a prompt, we look for image tags of the form [img-0], which are inserted by the Ollama server process. However, this can cause errors if the original prompt has these tags - typically an image not found error is returned.

This changes tag searching behavior to be similar to the 0.3.x series, which will largely avoid these problems. However,they can still happen when input text with these tags is used with image models. The correct solution is to escape the tags but this is a larger issue with special sequences in general so this is an incremental fix that should avoid the problem for the majority of cases.


🔄 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/7849 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 11/26/2024 **Status:** ✅ Merged **Merged:** 11/26/2024 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/embed` --- ### 📝 Commits (1) - [`459d689`](https://github.com/ollama/ollama/commit/459d689c2a073201ca9e78bb9e568a83d5a270d6) runner.go: Don't try to extract image tags for text models ### 📊 Changes **1 file changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `llama/runner/runner.go` (+9 -3) </details> ### 📄 Description When processing a prompt, we look for image tags of the form [img-0], which are inserted by the Ollama server process. However, this can cause errors if the original prompt has these tags - typically an image not found error is returned. This changes tag searching behavior to be similar to the 0.3.x series, which will largely avoid these problems. However,they can still happen when input text with these tags is used with image models. The correct solution is to escape the tags but this is a larger issue with special sequences in general so this is an incremental fix that should avoid the problem for the majority of cases. --- <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-13 00:02:40 -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#12536