We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be690b8 commit af395baCopy full SHA for af395ba
modules/helpers.py
@@ -194,13 +194,13 @@ def get_preffered_languages():
194
return ["en-US", "en", "de"]
195
196
197
-def num_tokens_from_string(string: str, model: str) -> int:
+def num_tokens_from_string(string: str, model: str = "gpt-4o-mini") -> int:
198
"""
199
Returns the number of tokens in a text string.
200
201
Args:
202
string (str): The string to count tokens in.
203
- model (str): Name of the model.
+ model (str): Name of the model. Default is 'gpt-4o-mini'
204
205
See https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken
206
0 commit comments