Support prompt file as positional arg in stage1
This commit is contained in:
8
prompts/smol_save_config.txt
Normal file
8
prompts/smol_save_config.txt
Normal 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:
|
||||
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user