Fix precommit check after moving to ruff (#927)

Lint check in main branch is failing. This fixes the lint check after we
moved to ruff in https://github.com/meta-llama/llama-stack/pull/921. We
need to move to a `ruff.toml` file as well as fixing and ignoring some
additional checks.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2025-02-02 09:46:45 -05:00 committed by GitHub
parent 4773092dd1
commit 34ab7a3b6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
217 changed files with 981 additions and 2681 deletions

View file

@ -73,9 +73,7 @@ class TestVisionModelInference:
assert expected_string in response.completion_message.content
@pytest.mark.asyncio
async def test_vision_chat_completion_streaming(
self, inference_model, inference_stack
):
async def test_vision_chat_completion_streaming(self, inference_model, inference_stack):
inference_impl, _ = inference_stack
images = [
@ -100,9 +98,7 @@ class TestVisionModelInference:
UserMessage(
content=[
image,
TextContentItem(
text="Describe this image in two sentences."
),
TextContentItem(text="Describe this image in two sentences."),
]
),
],
@ -112,18 +108,12 @@ class TestVisionModelInference:
]
assert len(response) > 0
assert all(
isinstance(chunk, ChatCompletionResponseStreamChunk)
for chunk in response
)
assert all(isinstance(chunk, ChatCompletionResponseStreamChunk) for chunk in response)
grouped = group_chunks(response)
assert len(grouped[ChatCompletionResponseEventType.start]) == 1
assert len(grouped[ChatCompletionResponseEventType.progress]) > 0
assert len(grouped[ChatCompletionResponseEventType.complete]) == 1
content = "".join(
chunk.event.delta.text
for chunk in grouped[ChatCompletionResponseEventType.progress]
)
content = "".join(chunk.event.delta.text for chunk in grouped[ChatCompletionResponseEventType.progress])
for expected_string in expected_strings:
assert expected_string in content