mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
hf non conv + tgi llms
This commit is contained in:
parent
e7f4e8b4a4
commit
071e77ccad
1 changed files with 19 additions and 0 deletions
|
@ -132,6 +132,25 @@ def test_completion_with_litellm_call_id():
|
||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
# pytest.fail(f"Error occurred: {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
|
def test_completion_cohere(): # commenting for now as the cohere endpoint is being flaky
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue