Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit e752ec7

Browse files
dhuangnmdhuangnm
and
dhuangnm
authored
Update utils.py (#174)
fix error in the docker --------- Co-authored-by: dhuangnm <[email protected]>
1 parent a3297db commit e752ec7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vllm/utils.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ def is_hip() -> bool:
119119

120120
@lru_cache(maxsize=None)
121121
def is_cpu() -> bool:
122-
from importlib.metadata import version
122+
from importlib.metadata import PackageNotFoundError, version
123123

124124
# UPSTREAM SYNC: needed for nm-vllm
125-
is_cpu_flag = "cpu" in version("nm-vllm")
126-
return is_cpu_flag
125+
try:
126+
return "cpu" in version("nm-vllm")
127+
except PackageNotFoundError:
128+
return False
127129

128130

129131
@lru_cache(maxsize=None)

0 commit comments

Comments
 (0)