diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index 5c001e9abd..61bd76f596 100644 Binary files a/litellm/__pycache__/__init__.cpython-311.pyc and b/litellm/__pycache__/__init__.cpython-311.pyc differ diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index 36517095ba..b64c5c7324 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 6ffef16a6c..db85691254 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -72,16 +72,17 @@ def test_completion_claude_stream(): pytest.fail(f"Error occurred: {e}") -# def test_completion_hf_api(): -# try: -# user_message = "write some code to find the sum of two numbers" -# messages = [{ "content": user_message,"role": "user"}] -# response = completion(model="stabilityai/stablecode-completion-alpha-3b-4k", messages=messages, custom_llm_provider="huggingface") -# # Add any assertions here to check the response -# print(response) -# except Exception as e: -# pytest.fail(f"Error occurred: {e}") +def test_completion_hf_api(): + try: + user_message = "write some code to find the sum of two numbers" + messages = [{ "content": user_message,"role": "user"}] + response = completion(model="stabilityai/stablecode-completion-alpha-3b-4k", messages=messages, custom_llm_provider="huggingface", logger_fn=logger_fn) + # Add any assertions here to check the response + print(response) + except Exception as e: + pytest.fail(f"Error occurred: {e}") +test_completion_hf_api() # def test_completion_hf_deployed_api(): # try: # user_message = "There's a llama in my garden 😱 What should I do?" diff --git a/litellm/utils.py b/litellm/utils.py index 2783de2ab0..64d4420c80 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -438,7 +438,7 @@ def client(original_function): litellm.email is not None or os.getenv("LITELLM_EMAIL", None) is not None or litellm.token is not None - or os.getenv("LITELLM_TOKEN", None) + or os.getenv("LITELLM_TOKEN", None) is not None ): # add to input, success and failure callbacks if user is using hosted product get_all_keys() if "lite_debugger" not in callback_list and litellm.logging: