mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(utils.py): round max tokens to be int always
This commit is contained in:
parent
eb779c61c6
commit
b7f1bd696e
2 changed files with 6 additions and 3 deletions
|
@ -2348,7 +2348,9 @@ def client(original_function):
|
|||
elif user_max_tokens + input_tokens > max_output_tokens:
|
||||
user_max_tokens = max_output_tokens - input_tokens
|
||||
print_verbose(f"user_max_tokens: {user_max_tokens}")
|
||||
kwargs["max_tokens"] = user_max_tokens
|
||||
kwargs["max_tokens"] = int(
|
||||
round(user_max_tokens)
|
||||
) # make sure max tokens is always an int
|
||||
except Exception as e:
|
||||
print_verbose(f"Error while checking max token limit: {str(e)}")
|
||||
# MODEL CALL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue