Skip to content

Commit

Permalink
Fix typing in generate function for AsyncLLMEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
mezuzza committed Dec 14, 2023
1 parent f1c8520 commit f09c990
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# formatting
yapf==0.32.0
toml==0.10.2
ruff==0.1.5

# type checking
Expand Down
13 changes: 7 additions & 6 deletions vllm/engine/async_llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
from functools import partial
from typing import (Any, Dict, Iterable, List, Optional, Set, Tuple, Type,
Union)
Union, AsyncIterator)

from vllm.config import ModelConfig
from vllm.engine.arg_utils import AsyncEngineArgs
Expand Down Expand Up @@ -401,11 +401,12 @@ async def add_request(
return stream

async def generate(
self,
prompt: Optional[str],
sampling_params: SamplingParams,
request_id: str,
prompt_token_ids: Optional[List[int]] = None) -> RequestOutput:
self,
prompt: Optional[str],
sampling_params: SamplingParams,
request_id: str,
prompt_token_ids: Optional[List[int]] = None
) -> AsyncIterator[RequestOutput]:
"""Generate outputs for a request.
Generate outputs for a request. This method is a coroutine. It adds the
Expand Down

0 comments on commit f09c990

Please sign in to comment.