Skip to content

Commit

Permalink
[BugFix] Use different mechanism to get vllm version in is_cpu func
Browse files Browse the repository at this point in the history
Using importlib version() function doesn't work in the docker image.

Introduced in vllm-project#3634

Equivalent fix to vllm-project#3735
  • Loading branch information
njhill committed Apr 2, 2024
1 parent a3c226e commit ef4145c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def is_hip() -> bool:

@lru_cache(maxsize=None)
def is_cpu() -> bool:
from importlib.metadata import version
is_cpu_flag = "cpu" in version("vllm")
import vllm
is_cpu_flag = "cpu" in vllm.__version__
return is_cpu_flag


Expand Down

0 comments on commit ef4145c

Please sign in to comment.