[PR #7303] [MERGED] runner.go: Merge partial unicode characters before sending #43623

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/7303
Author: @jessegross
Created: 10/21/2024
Status: Merged
Merged: 10/22/2024
Merged by: @jessegross

Base: mainHead: jessegross/unicode


📝 Commits (1)

  • b478413 runner.go: Merge partial unicode characters before sending

📊 Changes

2 files changed (+38 additions, -9 deletions)

View changed files

📝 integration/basic_test.go (+16 -0)
📝 llama/runner/runner.go (+22 -9)

📄 Description

We check for partial unicode characters and accumulate them before sending. However, when we did send, we still sent each individual piece separately, leading to broken output. This combines everything into a single group, which is also more efficient.

This also switches to the built-in check for valid unicode characters, which is stricter. After this, we should never send back an invalid sequence.

Fixes #7290


🔄 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/7303 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 10/21/2024 **Status:** ✅ Merged **Merged:** 10/22/2024 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/unicode` --- ### 📝 Commits (1) - [`b478413`](https://github.com/ollama/ollama/commit/b4784135025795fd68d24d1cf1e5b2ad3d2dce45) runner.go: Merge partial unicode characters before sending ### 📊 Changes **2 files changed** (+38 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `integration/basic_test.go` (+16 -0) 📝 `llama/runner/runner.go` (+22 -9) </details> ### 📄 Description We check for partial unicode characters and accumulate them before sending. However, when we did send, we still sent each individual piece separately, leading to broken output. This combines everything into a single group, which is also more efficient. This also switches to the built-in check for valid unicode characters, which is stricter. After this, we should never send back an invalid sequence. Fixes #7290 --- <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:13:58 -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#43623