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 28bee6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def __init__(
)

Check failure on line 204 in vllm/entrypoints/llm.py

View workflow job for this annotation

GitHub Actions / mypy (3.8)

Incompatible types in assignment (expression has type "Union[Type[vllm.v1.engine.llm_engine.LLMEngine], Type[vllm.engine.llm_engine.LLMEngine]]", variable has type "Union[vllm.v1.engine.llm_engine.LLMEngine, vllm.engine.llm_engine.LLMEngine]") [assignment]

Check failure on line 204 in vllm/entrypoints/llm.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Incompatible types in assignment (expression has type "Union[Type[vllm.v1.engine.llm_engine.LLMEngine], Type[vllm.engine.llm_engine.LLMEngine]]", variable has type "Union[vllm.v1.engine.llm_engine.LLMEngine, vllm.engine.llm_engine.LLMEngine]") [assignment]

Check failure on line 204 in vllm/entrypoints/llm.py

View workflow job for this annotation

GitHub Actions / mypy (3.10)

Incompatible types in assignment (expression has type "Union[Type[vllm.v1.engine.llm_engine.LLMEngine], Type[vllm.engine.llm_engine.LLMEngine]]", variable has type "Union[vllm.v1.engine.llm_engine.LLMEngine, vllm.engine.llm_engine.LLMEngine]") [assignment]

Check failure on line 204 in vllm/entrypoints/llm.py

View workflow job for this annotation

GitHub Actions / mypy (3.11)

Incompatible types in assignment (expression has type "Union[Type[vllm.v1.engine.llm_engine.LLMEngine], Type[vllm.engine.llm_engine.LLMEngine]]", variable has type "Union[vllm.v1.engine.llm_engine.LLMEngine, vllm.engine.llm_engine.LLMEngine]") [assignment]

Check failure on line 204 in vllm/entrypoints/llm.py

View workflow job for this annotation

GitHub Actions / mypy (3.12)

Incompatible types in assignment (expression has type "Union[Type[vllm.v1.engine.llm_engine.LLMEngine], Type[vllm.engine.llm_engine.LLMEngine]]", variable has type "Union[vllm.v1.engine.llm_engine.LLMEngine, vllm.engine.llm_engine.LLMEngine]") [assignment]
# 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[
V1LLMEngine,
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 28bee6d

Please sign in to comment.