From 9593df23c4ada5de5249df586f4355df6da4582a Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 31 Jan 2024 19:31:07 -0800 Subject: [PATCH] test: add more logging --- litellm/tests/test_model_max_token_adjust.py | 1 + litellm/utils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/litellm/tests/test_model_max_token_adjust.py b/litellm/tests/test_model_max_token_adjust.py index b026b62567..8469302a52 100644 --- a/litellm/tests/test_model_max_token_adjust.py +++ b/litellm/tests/test_model_max_token_adjust.py @@ -15,6 +15,7 @@ litellm.drop_params = True def test_completion_sagemaker(): + litellm.set_verbose = True response = completion( model="sagemaker/berri-benchmarking-Llama-2-70b-chat-hf-4", messages=[{"content": "Hello, how are you?", "role": "user"}], diff --git a/litellm/utils.py b/litellm/utils.py index 43319246f1..a954353c60 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2220,6 +2220,7 @@ def client(original_function): pass # allow call to fail normally 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 except Exception as e: print_verbose(f"Error while checking max token limit: {str(e)}")