Skip to content

Commit

Permalink
[Bugfix] Handle PackageNotFoundError when checking for xpu version (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Aug 12, 2024
1 parent a046f86 commit 91294d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,11 @@ def is_tpu() -> bool:

@lru_cache(maxsize=None)
def is_xpu() -> bool:
from importlib.metadata import version
is_xpu_flag = "xpu" in version("vllm")
from importlib.metadata import PackageNotFoundError, version
try:
is_xpu_flag = "xpu" in version("vllm")
except PackageNotFoundError:
return False
# vllm is not build with xpu
if not is_xpu_flag:
return False
Expand Down

0 comments on commit 91294d5

Please sign in to comment.