From 02d2d2a26dd807f5bba98ee5f19ab662ae7fff52 Mon Sep 17 00:00:00 2001 From: Valentyn Tymofieiev Date: Wed, 6 Nov 2024 18:24:10 -0800 Subject: [PATCH 1/2] Use sys.executable to find python command. --- sdks/python/apache_beam/ml/inference/vllm_inference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/inference/vllm_inference.py b/sdks/python/apache_beam/ml/inference/vllm_inference.py index b86d33ec16b1..075f3b6971e6 100644 --- a/sdks/python/apache_beam/ml/inference/vllm_inference.py +++ b/sdks/python/apache_beam/ml/inference/vllm_inference.py @@ -24,6 +24,7 @@ import threading import time import uuid +import sys from dataclasses import dataclass from typing import Any from typing import Dict @@ -118,7 +119,7 @@ def __init__(self, model_name: str, vllm_server_kwargs: Dict[str, str]): def start_server(self, retries=3): if not self._server_started: server_cmd = [ - 'python', + sys.executable, '-m', 'vllm.entrypoints.openai.api_server', '--model', From 3166474f8675c447bc325ec6af4d0468dd10e42d Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Thu, 7 Nov 2024 09:45:23 -0500 Subject: [PATCH 2/2] Make linter happy --- sdks/python/apache_beam/ml/inference/vllm_inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/inference/vllm_inference.py b/sdks/python/apache_beam/ml/inference/vllm_inference.py index 075f3b6971e6..799083d16ceb 100644 --- a/sdks/python/apache_beam/ml/inference/vllm_inference.py +++ b/sdks/python/apache_beam/ml/inference/vllm_inference.py @@ -21,10 +21,10 @@ import logging import os import subprocess +import sys import threading import time import uuid -import sys from dataclasses import dataclass from typing import Any from typing import Dict