Ask a question to get started
Enter to sendā¢Shift+Enter new line
Get the number of tokens present in the text.
Useful for checking if an input will fit in a model's context window.
get_num_tokens( self, text: str, ) -> int
text
str
The string input to tokenize.