nl2sql-bench / debug_server.py
ritvik360's picture
Upload folder using huggingface_hub
1a16689 verified
raw
history blame contribute delete
767 Bytes
import requests
space_url = "https://ritvik360-nl2sql-bench.hf.space"
print("1. Resetting environment...")
try:
res_reset = requests.post(f"{space_url}/reset", json={"task_name": "simple-filter"})
print(f"Reset Status: {res_reset.status_code}")
except Exception as e:
print(f"Network error on reset: {e}")
print("\n2. Sending test SQL step...")
try:
# We send a perfectly valid query that should score > 0
payload = {"query": "SELECT id, name, email, country FROM customers WHERE tier = 'gold'"}
res_step = requests.post(f"{space_url}/step", json=payload)
print(f"Step Status: {res_step.status_code}")
print(f"Step Response:\n{res_step.text}")
except Exception as e:
print(f"Network error on step: {e}")