Spaces:
Sleeping
Sleeping
Fix: HF_TOKEN + getenv pattern matches spec checklist exactly
Browse files- 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"
|
| 28 |
-
MODEL_NAME = os.getenv("MODEL_NAME"
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 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 |
|