Returns the number of tokens in a text
Arguments
- 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.,
gpt-4oor a tokenizer, e.g.,o200k_base. See also available tokenizers.
Returns the number of tokens in a text
a character string to encode to tokens, can be a vector
a model to use for tokenization, either a model name, e.g., gpt-4o
or a tokenizer, e.g., o200k_base.
See also available tokenizers.