x
This commit is contained in:
@@ -19,6 +19,7 @@ class Settings(BaseModel):
|
||||
openai_port: int = 8001
|
||||
vllm_openai_internal_url: str = "http://127.0.0.1:8001/v1"
|
||||
public_model_name: str = "Qwen_local_model"
|
||||
default_enable_thinking: bool = False
|
||||
reasoning_enabled: bool = False
|
||||
model_root: str = "/opt/model"
|
||||
offline_mode: bool = True
|
||||
@@ -49,6 +50,7 @@ def get_settings() -> Settings:
|
||||
openai_port=runtime["openai_port"],
|
||||
vllm_openai_internal_url=runtime["vllm_openai_internal_url"],
|
||||
public_model_name=runtime["public_model_name"],
|
||||
default_enable_thinking=runtime["default_enable_thinking"],
|
||||
reasoning_enabled=runtime["reasoning_enabled"],
|
||||
model_root=runtime["model_root"],
|
||||
offline_mode=runtime["offline_mode"],
|
||||
|
||||
@@ -74,6 +74,7 @@ def resolve_runtime_settings(content: dict[str, Any]) -> dict[str, Any]:
|
||||
"openai_port": openai_port,
|
||||
"vllm_openai_internal_url": internal_url.rstrip("/"),
|
||||
"public_model_name": _to_str(content.get("public_model_name"), "Qwen_local_model"),
|
||||
"default_enable_thinking": _to_bool(content.get("default_enable_thinking"), False),
|
||||
"api_key": str(content.get("api_key", "")).strip() or None,
|
||||
"reasoning_enabled": _to_bool(content.get("reasoning_enabled"), False),
|
||||
"tensor_parallel_size": _to_int(content.get("tensor_parallel_size"), 2),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -19,6 +20,7 @@ def build_command() -> list[str]:
|
||||
host = str(runtime["openai_host"])
|
||||
port = str(runtime["openai_port"])
|
||||
public_model_name = str(runtime["public_model_name"]).strip()
|
||||
default_enable_thinking = bool(runtime["default_enable_thinking"])
|
||||
reasoning_enabled = bool(runtime["reasoning_enabled"])
|
||||
api_key = runtime["api_key"] or ""
|
||||
dtype = str(updates["dtype"] or runtime["dtype"])
|
||||
@@ -56,6 +58,12 @@ def build_command() -> list[str]:
|
||||
cmd.append("--enable-auto-tool-choice")
|
||||
if updates["tool_call_parser"]:
|
||||
cmd.extend(["--tool-call-parser", str(updates["tool_call_parser"])])
|
||||
cmd.extend(
|
||||
[
|
||||
"--default-chat-template-kwargs",
|
||||
json.dumps({"enable_thinking": default_enable_thinking}),
|
||||
]
|
||||
)
|
||||
if reasoning_enabled and reasoning_parser:
|
||||
cmd.extend(["--reasoning-parser", reasoning_parser])
|
||||
if quantization:
|
||||
|
||||
Reference in New Issue
Block a user