-
Notifications
You must be signed in to change notification settings - Fork 35
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
chore: setup o200k_base tokenizer #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also want to update lines 5, 14, and 48-51:
Line 5 in 44ce38e
`gpt-tokenizer` is a highly optimized Token Byte Pair Encoder/Decoder for all OpenAI's models (including those used by GPT-2, GPT-3, GPT-3.5 and GPT-4). It's written in TypeScript, and is fully compatible with all modern JavaScript environments. |
Line 14 in 44ce38e
- Support for all current OpenAI models (available encodings: `r50k_base`, `p50k_base`, `p50k_edit` and `cl100k_base`) |
Lines 48 to 51 in 44ce38e
- https://unpkg.com/gpt-tokenizer/dist/cl100k_base.js | |
- https://unpkg.com/gpt-tokenizer/dist/p50k_base.js | |
- https://unpkg.com/gpt-tokenizer/dist/p50k_edit.js | |
- https://unpkg.com/gpt-tokenizer/dist/r50k_base.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Claas, I applied the requested changes.
Any idea when this will merge? |
@niieani @caugner Sry I am bumping this by tagging you. We're trying to move to GPT-4o but the token calculations are coming out to be wrong since the base is different for GPT-4 Turbo & GPT-4o. It is imperative we have this PR merged as we are using this package in production. Until this PR gets merged, we are blocked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@niieani Thanks for merging. Seems like there is a formatting issue with the code blocking it from being published to NPM? Possible to check on your end and make these fixes? |
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR integrates the new tokenizer for gpt-4o
o200k_base
.Encoding file:
https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken 214
Closes #42