[PR #10080] [MERGED] ollamarunner: Don't truncate a SameBatch #18413

Closed
opened 2026-04-16 06:34:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10080
Author: @jessegross
Created: 4/2/2025
Status: Merged
Merged: 4/2/2025
Merged by: @jessegross

Base: mainHead: jessegross/trunc


📝 Commits (1)

  • 7d5cc55 ollamarunner: Don't truncate a SameBatch

📊 Changes

2 files changed (+31 additions, -4 deletions)

View changed files

📝 runner/ollamarunner/cache.go (+2 -0)
📝 runner/ollamarunner/runner.go (+29 -4)

📄 Description

When truncating inputs to the the context window at the beginning of a sequence, we remove the minimum amount possible. However, this may cause us to truncate to the middle of a set of inputs that the model specified should not be split up. To avoid this, we need to remove the rest of the partial batch.


🔄 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/10080 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 4/2/2025 **Status:** ✅ Merged **Merged:** 4/2/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/trunc` --- ### 📝 Commits (1) - [`7d5cc55`](https://github.com/ollama/ollama/commit/7d5cc55941d425b3f6da64bb855693d3ca17d098) ollamarunner: Don't truncate a SameBatch ### 📊 Changes **2 files changed** (+31 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runner/ollamarunner/cache.go` (+2 -0) 📝 `runner/ollamarunner/runner.go` (+29 -4) </details> ### 📄 Description When truncating inputs to the the context window at the beginning of a sequence, we remove the minimum amount possible. However, this may cause us to truncate to the middle of a set of inputs that the model specified should not be split up. To avoid this, we need to remove the rest of the partial batch. --- <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-16 06:34:13 -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#18413