[CI] Fix mypy for vllm/v1/executor (#30517)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2025-12-12 18:05:34 +00:00
committed by GitHub
parent d2c919dcc2
commit 02a5880394
5 changed files with 20 additions and 13 deletions
+8 -5
View File
@@ -67,7 +67,7 @@ class UniProcExecutor(Executor):
kwargs: dict | None = None,
non_block: bool = False,
single_value: bool = False,
) -> Any | list[Any] | Future[Any | list[Any]]:
) -> Any:
if kwargs is None:
kwargs = {}
@@ -79,10 +79,13 @@ class UniProcExecutor(Executor):
result = run_method(self.driver_worker, method, args, kwargs)
if isinstance(result, AsyncModelRunnerOutput):
if (async_thread := self.async_output_thread) is not None:
get_output = result.get_output
if not single_value:
get_output = lambda go=result.get_output: [go()]
return async_thread.submit(get_output)
if single_value:
return async_thread.submit(result.get_output)
def get_output_list() -> list[Any]:
return [result.get_output()]
return async_thread.submit(get_output_list)
result = result.get_output()
future = Future[Any]()
future.set_result(result if single_value else [result])