diff --git a/litellm/llms/huggingface_restapi.py b/litellm/llms/huggingface_restapi.py index 8d652cf671..c885040a58 100644 --- a/litellm/llms/huggingface_restapi.py +++ b/litellm/llms/huggingface_restapi.py @@ -48,6 +48,8 @@ class HuggingfaceRestAPILLM: completion_url: str = "" if "https" in model: completion_url = model + elif custom_api_base: + completion_url = custom_api_base elif "HF_API_BASE" in os.environ: completion_url = os.getenv("HF_API_BASE", "") else: diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 31531678ca..d890c54153 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -83,16 +83,16 @@ def test_completion_claude_stream(): # pytest.fail(f"Error occurred: {e}") -def test_completion_hf_deployed_api(): - try: - user_message = "There's a llama in my garden 😱 What should I do?" - messages = [{ "content": user_message,"role": "user"}] - response = completion(model="huggingface/https://ji16r2iys9a8rjk2.us-east-1.aws.endpoints.huggingface.cloud", messages=messages, 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_deployed_api() +# def test_completion_hf_deployed_api(): +# try: +# user_message = "There's a llama in my garden 😱 What should I do?" +# messages = [{ "content": user_message,"role": "user"}] +# response = completion(model="huggingface/https://ji16r2iys9a8rjk2.us-east-1.aws.endpoints.huggingface.cloud", messages=messages, logger_fn=logger_fn) +# # Add any assertions here to check the response +# print(response) +# except Exception as e: +# pytest.fail(f"Error occurred: {e}") + # def test_completion_cohere(): # commenting for now as the cohere endpoint is being flaky # try: