-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add tokens count in TS SDK #16
Comments
+1 |
+1 |
I dug a bit into this. There seem to be a few approaches.
Any other ideas for supporting this that is a bit easier or lower hanging? |
Maybe we can use https://github.com/dqbd/tiktoken since it's a BPE tokenizer as well and works great. |
Author of gpt-tokenizer here. Just FYI I've rewritten |
This is extremely needed and important to determine cost/usage |
Good news – we expect have a separate package with this functionality released within a few days! |
@rattrayalex That's awesome! I know it's a big ask but do you mind commenting on this thread when it's available? |
Of course!
…On Wed, Jun 28, 2023 at 2:27 PM, Alex Wait ***@***.***> wrote:
@rattrayalex <https://github.com/rattrayalex> That's awesome! I know it's
a big ask but do you mind commenting on this thread when it's available?
—
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL6LSDFH5JKERI7ECA2UTXNRZSNANCNFSM6AAAAAAW734YU4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is now released! https://www.npmjs.com/package/@anthropic-ai/tokenizer |
@rattrayalex Does this help with completion token counts? That's the much more expensive one. |
Yes, you can use this to tokenize the responses as well. |
D'oh! Of course! Thanks! |
Do we have this counting system in here? https://colab.research.google.com/drive/1cY_YPaV0KUdveAj_nwy7V8gVEDZh_GDz#scrollTo=XBm0Dz-P-8Fm
The text was updated successfully, but these errors were encountered: