Eishaan commited on
Commit
53f659d
·
1 Parent(s): 2cccbf9

Fix: HF_TOKEN + getenv pattern matches spec checklist exactly

Browse files
Files changed (1) hide show
  1. inference.py +6 -5
inference.py CHANGED
@@ -23,11 +23,12 @@ import traceback
23
  # Server URL for the environment
24
  ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")
25
 
26
- # LLM Configuration
27
- API_BASE_URL = os.getenv("API_BASE_URL") or "https://router.huggingface.co/v1"
28
- MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct"
29
- # API key: spec requires OPENAI_API_KEY as primary variable name
30
- API_KEY = os.getenv("OPENAI_API_KEY") or os.getenv("HF_TOKEN") or os.getenv("API_KEY")
 
31
 
32
  SYSTEM_PROMPT = """You are an autonomous SQLite database migration engine. You receive the current schema and a target schema. Write SQL to transform the current state to the target state without losing row data.
33
 
 
23
  # Server URL for the environment
24
  ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")
25
 
26
+ # LLM Configuration — defaults required for API_BASE_URL and MODEL_NAME only
27
+ API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
28
+ MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
29
+ HF_TOKEN = os.getenv("HF_TOKEN") # No default must be set by user
30
+ # Also support OPENAI_API_KEY as primary (per spec) and API_KEY as alias
31
+ API_KEY = os.getenv("OPENAI_API_KEY") or HF_TOKEN or os.getenv("API_KEY")
32
 
33
  SYSTEM_PROMPT = """You are an autonomous SQLite database migration engine. You receive the current schema and a target schema. Write SQL to transform the current state to the target state without losing row data.
34