forked from openai/tiktoken
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on openai#331 Uses Regex in _encode_ordinary_native instead of fancy-regex, to get a 6x speedup. To make the regex patterns compatible with Regex, drops part of thpatterns for whitespaces, and handles the whitespaces with scripting instead of regex. Still with exact same output. _encode_native calls _encode_ordinary_native_impl directly (_encode_ordinary_native is a wrapper of _encode_ordinary_native now).
- Loading branch information
Showing
3 changed files
with
89 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters