Support prompt file as positional arg in stage1

This commit is contained in:
2026-04-10 16:17:20 +00:00
parent becee624c6
commit 6e44836af6
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
You are a helpful assistant with access to tools.
Available tools:
- save_config: Save a configuration object. Args: {"config": "object"}
User: Create a detailed configuration for a web server with the following sections: server (host, port, ssl), logging (level, format, outputs), cache (enabled, ttl, max_size), rate_limiting (enabled, requests_per_minute, burst), cors (enabled, origins, methods, headers), security (headers, csp, hsts). Use the save_config tool.
Assistant:

View File

@@ -12,6 +12,13 @@ from vllm import LLM, SamplingParams
MODEL_PATH = os.environ.get("MODEL_PATH", "/workspace/models/SmolLM3-3B")
PROMPT_FILE = os.environ.get("PROMPT_FILE", "/workspace/prompts/smol_write_file.txt")
# Also support passing as first positional arg
import sys
if len(sys.argv) > 1 and not sys.argv[1].startswith("-"):
if "/" in sys.argv[1]:
PROMPT_FILE = sys.argv[1]
else:
PROMPT_FILE = f"/workspace/prompts/{sys.argv[1]}"
MAX_TOKENS = int(os.environ.get("MAX_TOKENS", "512"))
TEMPERATURE = float(os.environ.get("TEMPERATURE", "0.0"))