-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(google-common): Support get num tokens #7818
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
We didn't support this before? Ooof. Good catch! A few thoughts, however.
Does this make sense @hans00? |
Agreed - thanks for this @hans00! @afirstenberg I defer to your expertise on the design here. Just for my own education, though - it looks like Probably a heavier lift, but Google's recommendation appears to be to use the tokenizer that ships with the Python SDK. I don't suppose there's a JS port for that, is there? If so, it'd be relatively straightforward to set it (or some function that wraps it) as the |
This came up in a quick search - doesn't support gemini-1.0-pro-vision, nor does it list support for any of the gemini-2.0 models (although I'm not sure if that's because they're using a new tokenizer for those, or because they haven't updated the docs). |
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.
.
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.
Sorry for the thrashing, but this needs some revision before it can be merged. See discussion on the PR.
Support
getNumTokens
for Google LLM / chat LLM