Skip to content

Commit

Permalink
Create 9999-bugfix-handle-packagenotfounderror-when-checking-for-xpu.…
Browse files Browse the repository at this point in the history
…patch
  • Loading branch information
sasha0552 authored Aug 12, 2024
1 parent 399009e commit 460c6a6
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/vllm/utils.py
+++ b/vllm/utils.py
@@ -341,8 +341,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

0 comments on commit 460c6a6

Please sign in to comment.