mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(huggingface_restapi.py): fix tests
This commit is contained in:
parent
459d650e04
commit
5a2e54c44d
2 changed files with 6 additions and 4 deletions
|
@ -1768,7 +1768,7 @@ def test_get_hf_task_for_model():
|
|||
# ################### Hugging Face TGI models ########################
|
||||
# # TGI model
|
||||
# # this is a TGI model https://huggingface.co/glaiveai/glaive-coder-7b
|
||||
def tgi_mock_post(url, data=None, json=None, headers=None):
|
||||
def tgi_mock_post(url, **kwargs):
|
||||
mock_response = MagicMock()
|
||||
mock_response.status_code = 200
|
||||
mock_response.headers = {"Content-Type": "application/json"}
|
||||
|
@ -1936,7 +1936,7 @@ async def test_openai_compatible_custom_api_base(provider):
|
|||
# hf_test_completion_none_task()
|
||||
|
||||
|
||||
def mock_post(url, data=None, json=None, headers=None):
|
||||
def mock_post(url, **kwargs):
|
||||
print(f"url={url}")
|
||||
if "text-classification" in url:
|
||||
raise Exception("Model not found")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue