Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- inference.py +6 -4
inference.py
CHANGED
|
@@ -31,10 +31,7 @@ except ImportError:
|
|
| 31 |
# Defaults are set only for API_BASE_URL and MODEL_NAME
|
| 32 |
# (and should reflect your active inference setup):
|
| 33 |
API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 34 |
-
MODEL_NAME = os.getenv("MODEL_NAME")
|
| 35 |
-
if MODEL_NAME is None:
|
| 36 |
-
print("MODEL_NAME environment variable is required", file=sys.stderr, flush=True)
|
| 37 |
-
sys.exit(1)
|
| 38 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 39 |
LOCAL_IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")
|
| 40 |
|
|
@@ -306,6 +303,11 @@ def main():
|
|
| 306 |
print("Please set HF_TOKEN or ensure .env file exists with the token", flush=True)
|
| 307 |
sys.exit(1)
|
| 308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
# Initialize agent
|
| 310 |
agent = SQLQualityAgent(API_BASE_URL, MODEL_NAME, HF_TOKEN, ENV_BASE_URL)
|
| 311 |
|
|
|
|
| 31 |
# Defaults are set only for API_BASE_URL and MODEL_NAME
|
| 32 |
# (and should reflect your active inference setup):
|
| 33 |
API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 34 |
+
MODEL_NAME = os.getenv("MODEL_NAME", "meta-llama/Llama-3.3-70B-Instruct")
|
|
|
|
|
|
|
|
|
|
| 35 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 36 |
LOCAL_IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")
|
| 37 |
|
|
|
|
| 303 |
print("Please set HF_TOKEN or ensure .env file exists with the token", flush=True)
|
| 304 |
sys.exit(1)
|
| 305 |
|
| 306 |
+
if not MODEL_NAME:
|
| 307 |
+
print("Error: MODEL_NAME environment variable is required",
|
| 308 |
+
flush=True, file=sys.stderr)
|
| 309 |
+
sys.exit(1)
|
| 310 |
+
|
| 311 |
# Initialize agent
|
| 312 |
agent = SQLQualityAgent(API_BASE_URL, MODEL_NAME, HF_TOKEN, ENV_BASE_URL)
|
| 313 |
|