fix: use venv python for vLLM service startup

This commit is contained in:
2025-11-23 15:21:52 +01:00
parent fdd724298a
commit 3f812704a2
2 changed files with 66 additions and 2 deletions

View File

@@ -102,11 +102,17 @@ async def start_model_process(model_name: str) -> bool:
env.update({
'HF_TOKEN': os.getenv('HF_TOKEN', ''),
'PORT': str(port),
'HOST': '0.0.0.0'
'HOST': '0.0.0.0',
'MODEL_NAME': model_config.get('model_name', model_name)
})
# Use venv python if it exists
script_dir = script_path.parent
venv_python = script_dir / 'venv' / 'bin' / 'python3'
python_cmd = str(venv_python) if venv_python.exists() else 'python3'
proc = subprocess.Popen(
['python3', str(script_path)],
[python_cmd, str(script_path)],
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,