Unverified Commit 91294d56 authored by sasha0552's avatar sasha0552 Committed by GitHub
Browse files

[Bugfix] Handle PackageNotFoundError when checking for xpu version (#7398)

parent a046f863
...@@ -344,8 +344,11 @@ def is_tpu() -> bool: ...@@ -344,8 +344,11 @@ def is_tpu() -> bool:
@lru_cache(maxsize=None) @lru_cache(maxsize=None)
def is_xpu() -> bool: def is_xpu() -> bool:
from importlib.metadata import version from importlib.metadata import PackageNotFoundError, version
try:
is_xpu_flag = "xpu" in version("vllm") is_xpu_flag = "xpu" in version("vllm")
except PackageNotFoundError:
return False
# vllm is not build with xpu # vllm is not build with xpu
if not is_xpu_flag: if not is_xpu_flag:
return False return False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment