mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(fix) linting fixes
This commit is contained in:
parent
de66e42fd0
commit
70fc10c010
2 changed files with 9 additions and 9 deletions
|
@ -1994,12 +1994,12 @@ def text_completion(
|
||||||
responses = [None for x in prompt] # init responses
|
responses = [None for x in prompt] # init responses
|
||||||
for i, individual_prompt in enumerate(prompt):
|
for i, individual_prompt in enumerate(prompt):
|
||||||
decoded_prompt = tokenizer.decode(individual_prompt) # type: ignore
|
decoded_prompt = tokenizer.decode(individual_prompt) # type: ignore
|
||||||
|
all_params = {**kwargs, **optional_params} # combine optional params and kwargs
|
||||||
response = text_completion(
|
response = text_completion(
|
||||||
model = model,
|
model = model, # type: ignore
|
||||||
prompt=decoded_prompt,
|
prompt = decoded_prompt, # type: ignore
|
||||||
*args,
|
*args,
|
||||||
|
**all_params,
|
||||||
**optional_params
|
|
||||||
)
|
)
|
||||||
responses[i] = response["choices"][0]
|
responses[i] = response["choices"][0]
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@ def test_completion_openai_prompt():
|
||||||
#print(response.choices[0].text)
|
#print(response.choices[0].text)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
test_completion_openai_prompt()
|
# test_completion_openai_prompt()
|
||||||
|
|
||||||
|
|
||||||
def test_completion_openai_prompt():
|
def test_completion_chatgpt_prompt():
|
||||||
try:
|
try:
|
||||||
print("\n gpt3.5 test\n")
|
print("\n gpt3.5 test\n")
|
||||||
response = text_completion(
|
response = text_completion(
|
||||||
|
@ -47,7 +47,7 @@ def test_completion_openai_prompt():
|
||||||
#print(response.choices[0].text)
|
#print(response.choices[0].text)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
test_completion_openai_prompt()
|
# test_completion_chatgpt_prompt()
|
||||||
|
|
||||||
|
|
||||||
def test_text_completion_basic():
|
def test_text_completion_basic():
|
||||||
|
@ -64,11 +64,11 @@ def test_text_completion_basic():
|
||||||
response_str = response["choices"][0]["text"]
|
response_str = response["choices"][0]["text"]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
test_text_completion_basic()
|
# test_text_completion_basic()
|
||||||
|
|
||||||
# def test_completion_hf_prompt_array():
|
# def test_completion_hf_prompt_array():
|
||||||
# try:
|
# try:
|
||||||
# litellm.set_verbose=True
|
# litellm.set_verbose=False
|
||||||
# print("\n testing hf mistral\n")
|
# print("\n testing hf mistral\n")
|
||||||
# response = text_completion(
|
# response = text_completion(
|
||||||
# model="huggingface/mistralai/Mistral-7B-v0.1",
|
# model="huggingface/mistralai/Mistral-7B-v0.1",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue