-
Notifications
You must be signed in to change notification settings - Fork 192
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
Is there an alternative that doesn't use node.js's file system module? #40
Comments
See my package that started off as a fork of this one: |
If you just want to count tokens, you could further trim down this package I made, which was forked off of this as well: |
Just FYI @iskandarreza your package is based on this one, which means it doesn't support counting tokens for |
Thank you for the heads up @niieani |
@niieani Thank you for the answer! I tried your fork and it works well. It's not exactly what they're putting out here: But it's pretty close and that's good enough for me. (Maybe I'm not using the right one? That's definitely a possibility, I'm using this property in entry of webpack.config.js: |
Yeah the one on the OpenAI is using the older tokenizer encoding on their website, not the cl100k. They use p50k. You also shouldn’t need to alias to the dist directory. |
Hi everyone, this is currently the de facto way to encode and decode strings in javascript. But I cannot import this node library in a chrome extension because it relies on the
fs
module:This is problematic since a great use case for this library is to count token usage BEFORE sending text to chatgpt. Is there any way this library can be made to not rely on
fs
so that it can be imported in a chrome extension like setting?The text was updated successfully, but these errors were encountered: