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

Clean up outdated comments in BPE tokenizer, pass configuration as a struct #455

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

robertknight
Copy link
Owner

In preparation for #453, do a pass over the BPE tokenizer to clean up outdated documentation and make passing configuration to Bpe::new more readable / easier to extend by using an options struct.

 - Remove GPT-2 regex constant. This has been moved to the `pre_tokenizers`
   module.
 - Remove references to regex splitting in `Bpe::new` docs
Make `Bpe::new` take configuration as a struct rather than separate args. This
will make it easier to extend and also allows to consumers to use the `Default`
impl to fill out unused args.

Also export the `EncodedByteSlice` and `EncodedBytes` types so they show up in
the docs. Otherwise these types show up as the original type (&str, String)
rather than the alias.
@robertknight robertknight merged commit 8708f8f into main Dec 9, 2024
2 checks passed
@robertknight robertknight deleted the bpe-cleanup branch December 9, 2024 07:54
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