parser.py support command parameter: protocol

This commit is contained in:
l.tingting
2025-09-02 11:25:06 +08:00
parent 2562ed0df4
commit ee5da7d955
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import os
def inference_with_vllm(
image,
prompt,
protocol="http",
ip="localhost",
port=8000,
temperature=0.1,
@@ -20,7 +21,7 @@ def inference_with_vllm(
model_name='model',
):
addr = f"http://{ip}:{port}/v1"
addr = f"{protocol}://{ip}:{port}/v1"
client = OpenAI(api_key="{}".format(os.environ.get("API_KEY", "0")), base_url=addr)
messages = []
messages.append(