[PR #15844] [MERGED] tokenizer: fix multi-regex BPE offset handling #62021

Closed
opened 2026-04-29 16:58:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15844
Author: @dhiltgen
Created: 4/27/2026
Status: Merged
Merged: 4/27/2026
Merged by: @dhiltgen

Base: mainHead: bpe_multi


📝 Commits (1)

  • ca028d6 tokenizer: fix multi-regex BPE offset handling

📊 Changes

2 files changed (+56 additions, -1 deletions)

View changed files

📝 tokenizer/bytepairencoding.go (+1 -1)
📝 tokenizer/bytepairencoding_test.go (+55 -0)

📄 Description

Use the current fragment offset when emitting unmatched spans during multi-regex BPE splitting. This avoids duplicating earlier prompt text and inflating token counts for multi-stage BPE tokenizers.


🔄 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/15844 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 4/27/2026 **Status:** ✅ Merged **Merged:** 4/27/2026 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `bpe_multi` --- ### 📝 Commits (1) - [`ca028d6`](https://github.com/ollama/ollama/commit/ca028d6d8e42834c5952cca0bdde165aa8995283) tokenizer: fix multi-regex BPE offset handling ### 📊 Changes **2 files changed** (+56 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tokenizer/bytepairencoding.go` (+1 -1) 📝 `tokenizer/bytepairencoding_test.go` (+55 -0) </details> ### 📄 Description Use the current fragment offset when emitting unmatched spans during multi-regex BPE splitting. This avoids duplicating earlier prompt text and inflating token counts for multi-stage BPE tokenizers. --- <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-29 16:58:46 -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#62021