parent
0c6e0b86c0
commit
a4d30a8211
1 changed files with 6 additions and 6 deletions
|
|
@ -70,12 +70,12 @@ def is_vllm_available():
|
||||||
global _IS_VLLM_AVAILABLE
|
global _IS_VLLM_AVAILABLE
|
||||||
if _IS_VLLM_AVAILABLE is not None:
|
if _IS_VLLM_AVAILABLE is not None:
|
||||||
return _IS_VLLM_AVAILABLE
|
return _IS_VLLM_AVAILABLE
|
||||||
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'list'])
|
import sys
|
||||||
installed_packages = [r.decode().split(' ')[0] for r in reqs.split()]
|
original_path = sys.path
|
||||||
if 'vllm' in installed_packages:
|
# Temporally remove current directory
|
||||||
_IS_VLLM_AVAILABLE = True
|
sys.path = [p for p in sys.path if p != '']
|
||||||
else:
|
_IS_VLLM_AVAILABLE = importlib.util.find_spec("vllm") is not None
|
||||||
_IS_VLLM_AVAILABLE = False
|
sys.path = original_path
|
||||||
return _IS_VLLM_AVAILABLE
|
return _IS_VLLM_AVAILABLE
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue