refactor(proxy_server.py): print statement showing how to add debug for logs

This commit is contained in:
Krrish Dholakia 2023-11-03 17:41:02 -07:00
parent 6c4816e214
commit 4e1885734a
8 changed files with 76 additions and 207 deletions

View file

@ -219,20 +219,19 @@ 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 hf_test_completion_tgi():
# litellm.huggingface_config(return_full_text=True)
# litellm.set_verbose=True
# try:
# response = litellm.completion(
# model="huggingface/mistralai/Mistral-7B-Instruct-v0.1",
# messages=[{ "content": "Hello, how are you?","role": "user"}],
# api_base="https://n9ox93a8sv5ihsow.us-east-1.aws.endpoints.huggingface.cloud",
# )
# # Add any assertions here to check the response
# print(response)
# except Exception as e:
# pytest.fail(f"Error occurred: {e}")
# hf_test_completion_tgi()
def hf_test_completion_tgi():
litellm.set_verbose=True
try:
response = litellm.completion(
model="huggingface/mistralai/Mistral-7B-Instruct-v0.1",
messages=[{ "content": "Hello, how are you?","role": "user"}],
api_base="https://3kk3h56912qga4-80.proxy.runpod.net",
)
# Add any assertions here to check the response
print(response)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
hf_test_completion_tgi()
# def hf_test_completion_tgi_stream():
# try: