[PR #12337] [MERGED] fix(integration): check truncated length #13790

Closed
opened 2026-04-13 00:36:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12337
Author: @mxyng
Created: 9/18/2025
Status: Merged
Merged: 9/18/2025
Merged by: @mxyng

Base: mainHead: mxyng/truncate


📝 Commits (1)

  • c857c14 fix(integration): check truncated length

📊 Changes

2 files changed (+109 additions, -62 deletions)

View changed files

📝 integration/embed_test.go (+101 -61)
📝 server/routes.go (+8 -1)

📄 Description

the integration test truncates the input to 1 token which is problematic because the model adds bos and eos tokens so 1 token will leave only the bos token.

increase context to 3 tokens while also add an error when the input after truncation leaves an empty input or only special tokens


🔄 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/12337 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 9/18/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/truncate` --- ### 📝 Commits (1) - [`c857c14`](https://github.com/ollama/ollama/commit/c857c144cb21a8a01d585b14fe0c0d26257e4173) fix(integration): check truncated length ### 📊 Changes **2 files changed** (+109 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `integration/embed_test.go` (+101 -61) 📝 `server/routes.go` (+8 -1) </details> ### 📄 Description the integration test truncates the input to 1 token which is problematic because the model adds bos and eos tokens so 1 token will leave only the bos token. increase context to 3 tokens while also add an error when the input after truncation leaves an empty input or only special tokens --- <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:36:35 -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#13790