forked from phoenix/litellm-mirror
hot fix litellm import
This commit is contained in:
parent
489a31adb7
commit
32a3b98c0a
2 changed files with 26 additions and 12 deletions
|
@ -197,16 +197,18 @@ def test_completion_replicate_stability_stream():
|
|||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
def test_completion_replicate_stability():
|
||||
model_name = "stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb"
|
||||
try:
|
||||
response = completion(model=model_name, messages=messages, custom_llm_provider="replicate")
|
||||
# Add any assertions here to check the response
|
||||
for result in response:
|
||||
print(result)
|
||||
print(response)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# def test_completion_replicate_stability():
|
||||
# model_name = "stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb"
|
||||
# try:
|
||||
# response = completion(model=model_name, messages=messages, custom_llm_provider="replicate")
|
||||
# # Add any assertions here to check the response
|
||||
# print(response)
|
||||
# for result in response:
|
||||
# print(result)
|
||||
# print(response)
|
||||
# except Exception as e:
|
||||
# pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_replicate_stability()
|
||||
|
||||
######## Test TogetherAI ########
|
||||
def test_completion_together_ai():
|
||||
|
|
|
@ -68,10 +68,22 @@ class ModelResponse:
|
|||
}
|
||||
|
||||
def __getitem__(self, key):
|
||||
return getattr(self, key)
|
||||
return getattr(self, key)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
setattr(self, key, value)
|
||||
setattr(self, key, value)
|
||||
|
||||
def __iter__(self):
|
||||
return iter(vars(self))
|
||||
|
||||
def __str__(self):
|
||||
result = f"""
|
||||
{self.choices}\n
|
||||
{self.created}\n
|
||||
{self.model}\n
|
||||
{self.usage}\n
|
||||
"""
|
||||
return result
|
||||
|
||||
|
||||
def print_verbose(print_statement):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue