Merge branch 'main' into evals_8

This commit is contained in:
Xi Yan 2024-10-27 11:42:00 -07:00
commit 46d3e64c9a
3 changed files with 132 additions and 38 deletions

View file

@ -138,11 +138,13 @@ async def test_completion(inference_settings):
"meta-reference",
"remote::ollama",
"remote::tgi",
"remote::together",
"remote::fireworks",
):
pytest.skip("Other inference providers don't support completion() yet")
response = await inference_impl.completion(
content="Roses are red,",
content="Micheael Jordan is born in ",
stream=False,
model=params["model"],
sampling_params=SamplingParams(
@ -151,7 +153,7 @@ async def test_completion(inference_settings):
)
assert isinstance(response, CompletionResponse)
assert "violets are blue" in response.content
assert "1963" in response.content
chunks = [
r
@ -166,7 +168,7 @@ async def test_completion(inference_settings):
]
assert all(isinstance(chunk, CompletionResponseStreamChunk) for chunk in chunks)
assert len(chunks) == 51
assert len(chunks) >= 1
last = chunks[-1]
assert last.stop_reason == StopReason.out_of_tokens
@ -180,6 +182,8 @@ async def test_completions_structured_output(inference_settings):
if provider.__provider_spec__.provider_type not in (
"meta-reference",
"remote::tgi",
"remote::together",
"remote::fireworks",
):
pytest.skip(
"Other inference providers don't support structured output in completions yet"