Skip to content

Bpe whitespace fixes#975

Merged
rasbt merged 1 commit intomainfrom
bpe
Mar 7, 2026
Merged

Bpe whitespace fixes#975
rasbt merged 1 commit intomainfrom
bpe

Conversation

@rasbt
Copy link
Owner

@rasbt rasbt commented Mar 7, 2026

The fix basically makes the train() method follow the same pre-tokenization logic as encode(), so both are consistent about spaces and line breaks. Before, training could merge across boundaries that encode() would never actually produce later.

So by learning merges only inside these pre-tokenized chunks, we avoid weird vocabulary entries like tokens where Ġ shows up at the end.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@rasbt rasbt merged commit 052c2de into main Mar 7, 2026
13 checks passed
@rasbt rasbt deleted the bpe branch March 7, 2026 19:56
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.

1 participant