Skip to content

Commit

Permalink
Change logic for detecting if vllm is available (#11657)
Browse files Browse the repository at this point in the history
* fix

* fix
  • Loading branch information
gc-fu authored Jul 25, 2024
1 parent 0c6e0b8 commit a4d30a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/llm/src/ipex_llm/transformers/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def is_vllm_available():
global _IS_VLLM_AVAILABLE
if _IS_VLLM_AVAILABLE is not None:
return _IS_VLLM_AVAILABLE
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'list'])
installed_packages = [r.decode().split(' ')[0] for r in reqs.split()]
if 'vllm' in installed_packages:
_IS_VLLM_AVAILABLE = True
else:
_IS_VLLM_AVAILABLE = False
import sys
original_path = sys.path
# Temporally remove current directory
sys.path = [p for p in sys.path if p != '']
_IS_VLLM_AVAILABLE = importlib.util.find_spec("vllm") is not None
sys.path = original_path
return _IS_VLLM_AVAILABLE


Expand Down

0 comments on commit a4d30a8

Please sign in to comment.