junaid0600 commited on
Commit
e5aa2dc
Β·
verified Β·
1 Parent(s): cf6d807

Update training/colab_notebook.py

Browse files
Files changed (1) hide show
  1. training/colab_notebook.py +9 -8
training/colab_notebook.py CHANGED
@@ -27,8 +27,9 @@ os.environ["ENV_URL"] = "https://junaid0600-sql-db-engineer-agent.hf.space"
27
  os.environ["MODEL_NAME"] = "unsloth/Qwen2.5-7B-Instruct"
28
  os.environ["OUTPUT_DIR"] = "./sdea-trained"
29
  os.environ["N_EPISODES"] = "10"
 
30
 
31
- print("βœ… Environment variables set")
32
  print(f"ENV_URL: {os.environ['ENV_URL']}")
33
 
34
  # ── CELL 4: Verify environment is live ────────────────────
@@ -40,17 +41,17 @@ def check_env():
40
  try:
41
  r = requests.get(f"{ENV_URL}/health", timeout=10)
42
  data = r.json()
43
- print(f"βœ… Environment healthy: {data}")
44
 
45
  r2 = requests.get(f"{ENV_URL}/tasks", timeout=10)
46
  tasks = r2.json()
47
- print(f"βœ… Tasks available: {tasks['total']}")
48
 
49
  r3 = requests.get(f"{ENV_URL}/progress", timeout=10)
50
- print(f"βœ… Progress endpoint: {r3.status_code}")
51
  return True
52
  except Exception as e:
53
- print(f"❌ Environment check failed: {e}")
54
  return False
55
 
56
  check_env()
@@ -58,7 +59,7 @@ check_env()
58
  # ── CELL 5: Quick episode test ────────────────────────────
59
  def test_episode():
60
  """Run one full episode to verify everything works."""
61
- print("\nπŸ§ͺ Testing full episode...")
62
 
63
  # Reset
64
  r = requests.post(f"{ENV_URL}/reset",
@@ -97,7 +98,7 @@ def test_episode():
97
  print(f" Final score: {summary.get('final_score', 'N/A')}")
98
  print(f" Improvement: {summary.get('improvement', 'N/A')}")
99
 
100
- print("\nβœ… Episode test complete!")
101
 
102
  test_episode()
103
 
@@ -212,4 +213,4 @@ def run_judge_demo():
212
  print("Trained to think like a senior DBA.")
213
  print("=" * 60)
214
 
215
- run_judge_demo()
 
27
  os.environ["MODEL_NAME"] = "unsloth/Qwen2.5-7B-Instruct"
28
  os.environ["OUTPUT_DIR"] = "./sdea-trained"
29
  os.environ["N_EPISODES"] = "10"
30
+ os.environ["MAX_STEPS"] = "300"
31
 
32
+ print("Environment variables set")
33
  print(f"ENV_URL: {os.environ['ENV_URL']}")
34
 
35
  # ── CELL 4: Verify environment is live ────────────────────
 
41
  try:
42
  r = requests.get(f"{ENV_URL}/health", timeout=10)
43
  data = r.json()
44
+ print(f"Environment healthy: {data}")
45
 
46
  r2 = requests.get(f"{ENV_URL}/tasks", timeout=10)
47
  tasks = r2.json()
48
+ print(f"Tasks available: {tasks['total']}")
49
 
50
  r3 = requests.get(f"{ENV_URL}/progress", timeout=10)
51
+ print(f"Progress endpoint: {r3.status_code}")
52
  return True
53
  except Exception as e:
54
+ print(f"Environment check failed: {e}")
55
  return False
56
 
57
  check_env()
 
59
  # ── CELL 5: Quick episode test ────────────────────────────
60
  def test_episode():
61
  """Run one full episode to verify everything works."""
62
+ print("\n Testing full episode...")
63
 
64
  # Reset
65
  r = requests.post(f"{ENV_URL}/reset",
 
98
  print(f" Final score: {summary.get('final_score', 'N/A')}")
99
  print(f" Improvement: {summary.get('improvement', 'N/A')}")
100
 
101
+ print("\n Episode test complete!")
102
 
103
  test_episode()
104
 
 
213
  print("Trained to think like a senior DBA.")
214
  print("=" * 60)
215
 
216
+ run_judge_demo()