mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 21:18:18 -04:00
moved renamed container.py to vllm_container.py
This commit is contained in:
@@ -9,7 +9,7 @@ from typing import Annotated
|
|||||||
|
|
||||||
import typer
|
import typer
|
||||||
|
|
||||||
from python.prompt_bench.container import check_gpu_free
|
from python.prompt_bench.vllm_container import check_gpu_free
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from typing import Annotated
|
|||||||
|
|
||||||
import typer
|
import typer
|
||||||
|
|
||||||
from python.prompt_bench.container import check_gpu_free, start_vllm, stop_vllm
|
from python.prompt_bench.vllm_container import check_gpu_free, start_vllm, stop_vllm
|
||||||
from python.prompt_bench.downloader import is_model_present
|
from python.prompt_bench.downloader import is_model_present
|
||||||
from python.prompt_bench.models import BenchmarkConfig
|
from python.prompt_bench.models import BenchmarkConfig
|
||||||
from python.prompt_bench.vllm_client import VLLMClient
|
from python.prompt_bench.vllm_client import VLLMClient
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import subprocess
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONTAINER_NAME = "vllm-bench"
|
CONTAINER_NAME = "vllm-bench"
|
||||||
VLLM_IMAGE = "vllm/vllm-openai:v0.8.5"
|
VLLM_IMAGE = "vllm/vllm-openai:v0.19.0"
|
||||||
|
|
||||||
|
|
||||||
def start_vllm(
|
def start_vllm(
|
||||||
@@ -49,6 +49,7 @@ def start_vllm(
|
|||||||
"4096",
|
"4096",
|
||||||
]
|
]
|
||||||
logger.info("Starting vLLM container with model: %s", model)
|
logger.info("Starting vLLM container with model: %s", model)
|
||||||
|
stop_vllm()
|
||||||
result = subprocess.run(command, capture_output=True, text=True, check=False)
|
result = subprocess.run(command, capture_output=True, text=True, check=False)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
msg = f"Failed to start vLLM container: {result.stderr.strip()}"
|
msg = f"Failed to start vLLM container: {result.stderr.strip()}"
|
||||||
@@ -60,7 +61,12 @@ def stop_vllm() -> None:
|
|||||||
"""Stop and remove the vLLM benchmark container."""
|
"""Stop and remove the vLLM benchmark container."""
|
||||||
logger.info("Stopping vLLM container")
|
logger.info("Stopping vLLM container")
|
||||||
subprocess.run(["docker", "stop", CONTAINER_NAME], capture_output=True, check=False)
|
subprocess.run(["docker", "stop", CONTAINER_NAME], capture_output=True, check=False)
|
||||||
subprocess.run(["docker", "rm", CONTAINER_NAME], capture_output=True, check=False)
|
subprocess.run(["docker", "rm", "-f", CONTAINER_NAME], capture_output=True, check=False)
|
||||||
|
subprocess.run(
|
||||||
|
["docker", "network", "disconnect", "-f", "bridge", CONTAINER_NAME],
|
||||||
|
capture_output=True,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
logger.info("vLLM container stopped and removed")
|
logger.info("vLLM container stopped and removed")
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user