View source: R/get_token_count.R
get_token_count | R Documentation |
Returns the number of tokens in a text
get_token_count(text, model)
text |
a character string to encode to tokens, can be a vector |
model |
a model to use for tokenization, either a model name, e.g., |
the number of tokens in the text, vector of integers
model_to_tokenizer()
, get_tokens()
get_token_count("Hello World", "gpt-4o")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.