Merge branch 'main' into litellm_logging_fix
This commit is contained in:
commit
96b46a4d49
@ -1621,7 +1621,6 @@ def openai_token_counter(
|
||||
num_tokens += tokens_per_message
|
||||
if message.get("role", None) == "system":
|
||||
includes_system_message = True
|
||||
includes_system_message = True
|
||||
for key, value in message.items():
|
||||
if isinstance(value, str):
|
||||
num_tokens += len(encoding.encode(value, disallowed_special=()))
|
||||
@ -1873,7 +1872,6 @@ def _format_type(props, indent):
|
||||
return "any"
|
||||
|
||||
|
||||
|
||||
def token_counter(
|
||||
model="",
|
||||
custom_tokenizer: Optional[dict] = None,
|
||||
@ -1962,7 +1960,6 @@ def token_counter(
|
||||
count_response_tokens=count_response_tokens,
|
||||
tools=tools,
|
||||
tool_choice=tool_choice,
|
||||
tool_choice=tool_choice,
|
||||
)
|
||||
else:
|
||||
print_verbose(
|
||||
@ -1976,7 +1973,6 @@ def token_counter(
|
||||
count_response_tokens=count_response_tokens,
|
||||
tools=tools,
|
||||
tool_choice=tool_choice,
|
||||
tool_choice=tool_choice,
|
||||
)
|
||||
else:
|
||||
num_tokens = len(encoding.encode(text, disallowed_special=())) # type: ignore
|
||||
|
||||
Loading…
Reference in New Issue
Block a user