Skip to content

Commit

Permalink
🎨 engine type hint
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Runde <Joseph.Runde@ibm.com>
  • Loading branch information
joerunde committed Oct 31, 2024
1 parent d38d052 commit bdc0443
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import itertools
import warnings
from contextlib import contextmanager
from typing import (Any, ClassVar, Dict, List, Optional, Sequence, Tuple,
from typing import (Any, ClassVar, Dict, List, Optional, Sequence, Tuple, Type,
Union, cast, overload)

from tqdm import tqdm
Expand Down Expand Up @@ -204,7 +204,9 @@ def __init__(
)
# Logic to switch between engines is done at runtime instead of import
# to avoid import order issues
self.engine_class = V1LLMEngine if envs.VLLM_USE_V1 else LLMEngine
self.engine_class: Union[
Type[V1LLMEngine],
Type[LLMEngine]] = V1LLMEngine if envs.VLLM_USE_V1 else LLMEngine
self.llm_engine = self.engine_class.from_engine_args(
engine_args, usage_context=UsageContext.LLM_CLASS)
self.request_counter = Counter()
Expand Down

0 comments on commit bdc0443

Please sign in to comment.