mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-07 00:24:03 +00:00
(test) cleanup remove text_completion testing from completion()
This commit is contained in:
@@ -10,7 +10,7 @@ sys.path.insert(
|
||||
) # Adds the parent directory to the system path
|
||||
import pytest
|
||||
import litellm
|
||||
from litellm import embedding, completion, text_completion, completion_cost
|
||||
from litellm import embedding, completion, completion_cost
|
||||
from litellm import RateLimitError
|
||||
|
||||
user_message = "Write a short poem about the sky"
|
||||
@@ -387,44 +387,6 @@ def test_completion_openai():
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_openai()
|
||||
|
||||
|
||||
def test_completion_openai_prompt():
|
||||
try:
|
||||
response = text_completion(
|
||||
model="gpt-3.5-turbo", prompt="What's the weather in SF?"
|
||||
)
|
||||
response_str = response["choices"][0]["text"]
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
def test_completion_openai_prompt_array():
|
||||
try:
|
||||
litellm.set_verbose=False
|
||||
response = text_completion(
|
||||
model="text-davinci-003", prompt="good morning", max_tokens=10, logprobs=10, echo=True
|
||||
)
|
||||
print(response)
|
||||
response_str = response["choices"][0]["text"]
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_openai_prompt_array()
|
||||
|
||||
def test_completion_hf_prompt_array():
|
||||
try:
|
||||
litellm.set_verbose=False
|
||||
response = text_completion(
|
||||
model="huggingface/bigcode/starcoder",
|
||||
prompt=[[33074, 25, 1374],[284, 651, 284, 479, 17716, 322, 13, 25750]],
|
||||
max_tokens=10, logprobs=10,
|
||||
echo=True
|
||||
)
|
||||
print(response)
|
||||
response_str = response["choices"][0]["text"]
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_hf_prompt_array()
|
||||
|
||||
def test_completion_text_openai():
|
||||
try:
|
||||
response = completion(model="gpt-3.5-turbo-instruct", messages=messages)
|
||||
|
||||
Reference in New Issue
Block a user