[PR #833] [MERGED] Fix Issue with Leading Whitespaces in Decoded Context #10352

Closed
opened 2026-04-12 22:58:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/833
Author: @deichbewohner
Created: 10/18/2023
Status: Merged
Merged: 10/18/2023
Merged by: @mxyng

Base: mainHead: leadingspace


📝 Commits (5)

  • 5dc0cff fix whitespace removal
  • 90c49be moved removal of leading space into Predict
  • 46b9953 use strings.TrimLeft to remove spaces
  • ce6197a removed redundant strings.CutPrefix from Decode
  • 730996e use TrimPrefix instead of TrimLeft

📊 Changes

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

View changed files

📝 llm/llama.go (+3 -3)

📄 Description

This Pull Request addresses a bug in the Decode function where leading whitespaces are not properly removed from the decoded context.

I have tested the behavior both before and after making this change:

  • Before: The leading whitespaces were present when using the context.
  • After: The leading whitespaces were properly removed.

🔄 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/833 **Author:** [@deichbewohner](https://github.com/deichbewohner) **Created:** 10/18/2023 **Status:** ✅ Merged **Merged:** 10/18/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `leadingspace` --- ### 📝 Commits (5) - [`5dc0cff`](https://github.com/ollama/ollama/commit/5dc0cff4592132635a2445ef6ed80103927e08af) fix whitespace removal - [`90c49be`](https://github.com/ollama/ollama/commit/90c49bed573fdc8e1c2851016edf9c957884a145) moved removal of leading space into Predict - [`46b9953`](https://github.com/ollama/ollama/commit/46b9953f32d665010367f55362aff41b4b338a8d) use strings.TrimLeft to remove spaces - [`ce6197a`](https://github.com/ollama/ollama/commit/ce6197a8e00cb8bc44d4fd1eb89d1b2d439ebf75) removed redundant strings.CutPrefix from Decode - [`730996e`](https://github.com/ollama/ollama/commit/730996e5306f50b9dd7e9159ca0f24aa22394144) use TrimPrefix instead of TrimLeft ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `llm/llama.go` (+3 -3) </details> ### 📄 Description This Pull Request addresses a bug in the Decode function where leading whitespaces are not properly removed from the decoded context. I have tested the behavior both before and after making this change: - Before: The leading whitespaces were present when using the context. - After: The leading whitespaces were properly removed. --- <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-12 22:58:49 -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#10352