Skip to content

Commit bfd6d38

Browse files
youngkentmzusman
authored andcommitted
Type-fix: make execute_model output type optional (vllm-project#12020)
1 parent 3add79f commit bfd6d38

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

vllm/v1/executor/uniproc_executor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def execute_model(
7070
scheduler_output,
7171
) -> ModelRunnerOutput:
7272
output = self.worker.execute_model(scheduler_output)
73+
assert output is not None
7374
return output
7475

7576
def profile(self, is_start: bool = True):

vllm/v1/worker/gpu_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def compile_or_warm_up_model(self) -> None:
200200
def execute_model(
201201
self,
202202
scheduler_output: "SchedulerOutput",
203-
) -> ModelRunnerOutput:
203+
) -> Optional[ModelRunnerOutput]:
204204
output = self.model_runner.execute_model(scheduler_output)
205205
return output if self.rank == 0 else None
206206

0 commit comments

Comments
 (0)