Skip to content

fix: decode tokens to avoid re-encoding them - #403

Merged
stephantul merged 2 commits into
mainfrom
decode-tokens-to-re-encode-them
Oct 18, 2026
Merged

stephantul merged 2 commits into
mainfrom
decode-tokens-to-re-encode-them

Conversation

@stephantul

Copy link
Copy Markdown
Contributor

Fixes #402

This PR decodes encoded tokens again so their surface-level forms can be safely ingested by a tokenizer. This fixes the leading space issue in #402.

@stephantul
stephantul requested a review from Pringled October 18, 2026 16:29
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] Changes token encoding logic in the tokenizer.

The PR appears safe to merge, with a non-blocking request to test encoded leading spaces.

Reviews (1) · Last reviewed commit: "fix: decode tokens to avoid re-encoding ..." · Reviewed by Greptile

Comment thread tests/test_distillation.py
@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
model2vec/tokenizer/tokenizer.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stephantul
stephantul merged commit 2993f4f into main Oct 18, 2026
11 checks passed
@stephantul
stephantul deleted the decode-tokens-to-re-encode-them branch October 18, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Byte-level BPE custom vocabulary distillation double-encodes token prefixes

1 participant