-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Adding new API for Counting Number of Token from Input Text #13
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
Conversation
ramitsurana
commented
Apr 16, 2021
- Updated git ignore
- Remove unused import statement
- Add count token from text api
@ramitsurana Thanks for the contribution. Dividing the number of characters by 4 only offers an estimate for the number of tokens, and for certain kinds of text (code, symbols, non-English languages, etc) it may not be very accurate at all. If we were to add a token counter to this project, We'd likely want to provide the real count of tokens instead, which is non-trivial – we'd either need to add in something similar to this (but more lightweight) or call a backend endpoint that offers this functionality. |
@schnerd Sure, Thanks for your feedback and sharing the useful insights. I think we could do it by creating a endpoint at the backend and calling it for this command,so in case in future we want to use this functionality for other commands ( like for file create command for comparison between the tokens available in the account vs the tokens that would be consumed by the file that we want to process) we could use it more easily. |
* Add support for modifying files and file_set support (#4) * Add support for modifying files and file_set support * Bump version * Updated file sets to use name everywhere * Bump to 0.4.0 * Added cli support for file and fileset (#5) * Added cli support for file and fileset * Back to .4.0 * Typo * Add some basic tests to confirm that array stuff works * Added a test for multiple prompts. * refactor retriever endpoint (#6) * Make higherlevel have class methods so you can call with openai.HigherLevel.answer (#7) * refactor retriever endpoint * Actually just make everything a classmethod so you can call it like openai.HigherLevel * Rename file_sets to collections everywhere (#8) * Rename file_sets to collections everywhere * Remove collections (#10) * Higherlevel endpoints now point to /v1 (#11) * Higherlevel endpoints now point to v1 * new line * Move answer and classification to top level attributes, rename higherlevel (#12) * Move answer and classification to top level attributes * New namespaces for answers and classifications * Meant to make the method create * Go up the class stack since we don't need all the things that engineapiresource gives us * Add file support to search (#13) * Add file support to search * Add support for max_rerank * Added return_metadata support * Fixed some cherry pick issues
I'm going to close this PR for now since we don't currently support a tokenizer in our API. Feel free to open an issue and we can track progress there |
* Add support for modifying files and file_set support (openai#4) * Add support for modifying files and file_set support * Bump version * Updated file sets to use name everywhere * Bump to 0.4.0 * Added cli support for file and fileset (openai#5) * Added cli support for file and fileset * Back to .4.0 * Typo * Add some basic tests to confirm that array stuff works * Added a test for multiple prompts. * refactor retriever endpoint (openai#6) * Make higherlevel have class methods so you can call with openai.HigherLevel.answer (openai#7) * refactor retriever endpoint * Actually just make everything a classmethod so you can call it like openai.HigherLevel * Rename file_sets to collections everywhere (openai#8) * Rename file_sets to collections everywhere * Remove collections (openai#10) * Higherlevel endpoints now point to /v1 (openai#11) * Higherlevel endpoints now point to v1 * new line * Move answer and classification to top level attributes, rename higherlevel (openai#12) * Move answer and classification to top level attributes * New namespaces for answers and classifications * Meant to make the method create * Go up the class stack since we don't need all the things that engineapiresource gives us * Add file support to search (openai#13) * Add file support to search * Add support for max_rerank * Added return_metadata support * Fixed some cherry pick issues
fix: correct typo in README regarding tool responses