Spaces:
Sleeping
Sleeping
Update training/train_agent.py
Browse files- training/train_agent.py +10 -12
training/train_agent.py
CHANGED
|
@@ -252,17 +252,15 @@ def build_dataset():
|
|
| 252 |
max_steps = s.get("max_steps", 50)
|
| 253 |
|
| 254 |
prompt = (
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
f"What is your FIRST action?"
|
| 265 |
-
)
|
| 266 |
|
| 267 |
examples.append({
|
| 268 |
"prompt": prompt,
|
|
@@ -337,7 +335,7 @@ def train():
|
|
| 337 |
per_device_train_batch_size = 1, # was 2 β frees memory for 1.5B
|
| 338 |
gradient_accumulation_steps = 2, # was 8 β was hiding steps, now shows them
|
| 339 |
learning_rate = 2e-5, # was 5e-5 β lower = more stable for small model
|
| 340 |
-
max_completion_length =
|
| 341 |
num_generations = 4,
|
| 342 |
logging_steps = 1, # was 10 β see every step
|
| 343 |
save_steps = 20,
|
|
|
|
| 252 |
max_steps = s.get("max_steps", 50)
|
| 253 |
|
| 254 |
prompt = (
|
| 255 |
+
f"{SYSTEM_PROMPT}\n\n"
|
| 256 |
+
f"Scenario: {s.get('id')} β {s.get('description','')}\n"
|
| 257 |
+
f"Slow queries: {', '.join(q['id'] for q in s.get('slow_queries',[]))}\n"
|
| 258 |
+
f"Tables: {', '.join(t['name'] for t in s.get('tables',[]))}\n"
|
| 259 |
+
f"Missing indexes: {json.dumps(s.get('missing_index_hints',[]))}\n"
|
| 260 |
+
f"Performance: {baseline}/100 β target {target}/100\n\n"
|
| 261 |
+
f"Respond with JSON only:"
|
| 262 |
+
)
|
| 263 |
+
|
|
|
|
|
|
|
| 264 |
|
| 265 |
examples.append({
|
| 266 |
"prompt": prompt,
|
|
|
|
| 335 |
per_device_train_batch_size = 1, # was 2 β frees memory for 1.5B
|
| 336 |
gradient_accumulation_steps = 2, # was 8 β was hiding steps, now shows them
|
| 337 |
learning_rate = 2e-5, # was 5e-5 β lower = more stable for small model
|
| 338 |
+
max_completion_length = 512,
|
| 339 |
num_generations = 4,
|
| 340 |
logging_steps = 1, # was 10 β see every step
|
| 341 |
save_steps = 20,
|