From 071e77ccada218ef256fa8bc1344cb642f518abe Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 18 Sep 2023 10:43:40 -0700 Subject: [PATCH] hf non conv + tgi llms --- litellm/tests/test_completion.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 9fadd2fcac..4dce3c9ec6 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -132,6 +132,25 @@ def test_completion_with_litellm_call_id(): # except Exception as e: # pytest.fail(f"Error occurred: {e}") +# using Non TGI or conversational LLMs +def hf_test_completion(): + try: + # litellm.set_verbose=True + user_message = "My name is Merve and my favorite" + messages = [{ "content": user_message,"role": "user"}] + response = completion( + model="huggingface/roneneldan/TinyStories-3M", + messages=messages, + api_base="https://p69xlsj6rpno5drq.us-east-1.aws.endpoints.huggingface.cloud", + task=None, + ) + # Add any assertions here to check the response + print(response) + + except Exception as e: + pytest.fail(f"Error occurred: {e}") + +hf_test_completion() def test_completion_cohere(): # commenting for now as the cohere endpoint is being flaky try: