Update inference.py
Browse files- inference.py +6 -6
inference.py
CHANGED
|
@@ -412,12 +412,12 @@ def run_inference(task_id: int, model_name: str, api_base: str, api_key: str) ->
|
|
| 412 |
|
| 413 |
|
| 414 |
def main():
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
|
| 419 |
-
print(f"[DEBUG] Starting ATC inference with model: {
|
| 420 |
-
print(f"[DEBUG] API base: {
|
| 421 |
|
| 422 |
total_score = 0.0
|
| 423 |
results = []
|
|
@@ -425,7 +425,7 @@ def main():
|
|
| 425 |
for task_id in [1, 2, 3]:
|
| 426 |
print(f"\n[DEBUG] ===== Running Task {task_id} =====")
|
| 427 |
try:
|
| 428 |
-
score, reward, log = run_inference(task_id,
|
| 429 |
results.append({"task_id": task_id, "score": score, "reward": reward})
|
| 430 |
total_score += score
|
| 431 |
except Exception as e:
|
|
|
|
| 412 |
|
| 413 |
|
| 414 |
def main():
|
| 415 |
+
API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 416 |
+
MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
|
| 417 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 418 |
|
| 419 |
+
print(f"[DEBUG] Starting ATC inference with model: {MODEL_NAME}")
|
| 420 |
+
print(f"[DEBUG] API base: {API_BASE_URL}")
|
| 421 |
|
| 422 |
total_score = 0.0
|
| 423 |
results = []
|
|
|
|
| 425 |
for task_id in [1, 2, 3]:
|
| 426 |
print(f"\n[DEBUG] ===== Running Task {task_id} =====")
|
| 427 |
try:
|
| 428 |
+
score, reward, log = run_inference(task_id, MODEL_NAME, API_BASE_URL, HF_TOKEN)
|
| 429 |
results.append({"task_id": task_id, "score": score, "reward": reward})
|
| 430 |
total_score += score
|
| 431 |
except Exception as e:
|