From 1f172c3a77b731f14d7c9f5472d59aeb7a6ae24e Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 9 Oct 2024 13:15:28 -0400 Subject: [PATCH] [CI/Build] mypy: check vllm/entrypoints (#9194) Signed-off-by: Russell Bryant Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com> --- tools/mypy.sh | 2 +- vllm/entrypoints/llm.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/mypy.sh b/tools/mypy.sh index 4e358faafe8de..e6187a08ffd98 100755 --- a/tools/mypy.sh +++ b/tools/mypy.sh @@ -19,7 +19,7 @@ run_mypy vllm/attention #run_mypy vllm/core run_mypy vllm/distributed run_mypy vllm/engine -#run_mypy vllm/entrypoints +run_mypy vllm/entrypoints run_mypy vllm/executor #run_mypy vllm/inputs run_mypy vllm/logging diff --git a/vllm/entrypoints/llm.py b/vllm/entrypoints/llm.py index 7ad352cd87526..2010381076c7d 100644 --- a/vllm/entrypoints/llm.py +++ b/vllm/entrypoints/llm.py @@ -514,10 +514,13 @@ def chat( # Handle multi and single conversations if is_list_of(messages, list): # messages is List[List[...]] - list_of_messages = messages + list_of_messages = cast(List[List[ChatCompletionMessageParam]], + messages) else: # messages is List[...] - list_of_messages = [messages] + list_of_messages = [ + cast(List[ChatCompletionMessageParam], messages) + ] prompts: List[Union[TokensPrompt, TextPrompt]] = []