Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- inference.py +1 -6
inference.py
CHANGED
|
@@ -130,10 +130,8 @@ Return ONLY the fixed SQL. No explanation."""
|
|
| 130 |
# Handle rate limits (429) manually with backoff
|
| 131 |
if "429" in str(e) and attempt < 3:
|
| 132 |
wait = 4 * (2 ** attempt)
|
| 133 |
-
print(f"[DEBUG] Rate limited, retrying in {wait}s...", flush=True)
|
| 134 |
time.sleep(wait)
|
| 135 |
continue
|
| 136 |
-
print(f"[DEBUG] LLM call failed: {e}", flush=True)
|
| 137 |
return broken_sql
|
| 138 |
return broken_sql
|
| 139 |
|
|
@@ -189,7 +187,6 @@ def run_task(task_id: str) -> float:
|
|
| 189 |
success = score >= 0.5
|
| 190 |
|
| 191 |
except Exception as exc:
|
| 192 |
-
print(f"[DEBUG] Task {task_id} error: {exc}", flush=True)
|
| 193 |
score = 0.15 # Non-zero safe default
|
| 194 |
success = False
|
| 195 |
|
|
@@ -222,15 +219,13 @@ def main():
|
|
| 222 |
|
| 223 |
avg = sum(all_scores) / len(all_scores)
|
| 224 |
final_data["avg_score"] = avg
|
| 225 |
-
print(f"[SUMMARY] tasks={len(ALL_TASKS)} avg_score={avg:.4f}", flush=True)
|
| 226 |
|
| 227 |
# Save to JSON for local tracking
|
| 228 |
try:
|
| 229 |
with open(results_path, "w") as f:
|
| 230 |
json.dump(final_data, f, indent=2)
|
| 231 |
-
print(f"[DEBUG] Results saved to {results_path}", flush=True)
|
| 232 |
except Exception as e:
|
| 233 |
-
|
| 234 |
|
| 235 |
|
| 236 |
if __name__ == "__main__":
|
|
|
|
| 130 |
# Handle rate limits (429) manually with backoff
|
| 131 |
if "429" in str(e) and attempt < 3:
|
| 132 |
wait = 4 * (2 ** attempt)
|
|
|
|
| 133 |
time.sleep(wait)
|
| 134 |
continue
|
|
|
|
| 135 |
return broken_sql
|
| 136 |
return broken_sql
|
| 137 |
|
|
|
|
| 187 |
success = score >= 0.5
|
| 188 |
|
| 189 |
except Exception as exc:
|
|
|
|
| 190 |
score = 0.15 # Non-zero safe default
|
| 191 |
success = False
|
| 192 |
|
|
|
|
| 219 |
|
| 220 |
avg = sum(all_scores) / len(all_scores)
|
| 221 |
final_data["avg_score"] = avg
|
|
|
|
| 222 |
|
| 223 |
# Save to JSON for local tracking
|
| 224 |
try:
|
| 225 |
with open(results_path, "w") as f:
|
| 226 |
json.dump(final_data, f, indent=2)
|
|
|
|
| 227 |
except Exception as e:
|
| 228 |
+
pass
|
| 229 |
|
| 230 |
|
| 231 |
if __name__ == "__main__":
|