Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify token set #31

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Verify token set #31

merged 2 commits into from
Oct 17, 2024

Conversation

hendrikvanantwerpen
Copy link
Contributor

When trying to make the example a little more interesting, I acidentally used an invalid token set: one token would not re-encode to itself. This adds a verification step after BPE construction to explicitly prevent this, instead of just getting strange results. Since BPE construction is expensive already, I don't think this extra step is a problem. (And it doesn't happen when loading a serialized instance!)

I was looking at the example to have it include multiple merge steps, instead of just two-byte pairs. I still need to update the README to show what it looks like now.

@hendrikvanantwerpen hendrikvanantwerpen self-assigned this Oct 16, 2024
@hendrikvanantwerpen hendrikvanantwerpen marked this pull request as ready for review October 16, 2024 19:27
@hendrikvanantwerpen hendrikvanantwerpen merged commit 5b127c9 into main Oct 17, 2024
3 checks passed
@hendrikvanantwerpen hendrikvanantwerpen deleted the verify-tokens branch October 17, 2024 08:31
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.

2 participants