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

Fix for loading tokenizers using non-utf8 strings #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ThomasProg
Copy link

After upgrading to Tokenizers 0.20.0 or higher, BPEs can now encode into strings with non-utf8 characters.
It makes the current version of tokenizers-cpp impossible to load a tokenizer created with a newer version of Tokenizers.

This pull request is to solve that issue, simply replacing std::string::from_utf8(), causing a previous exception, into String::from_utf8_lossy(), which allows non-utf8 strings.

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