K variants for training (free text, EPOD tool names), second attempt only for failed tasks, docs/epod-syntax-hint.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,15 @@ def done_keys():
|
||||
return {(r["task"], r["attempt"]) for r in map(json.loads, open(path))}
|
||||
|
||||
|
||||
def failed_first_attempts(min_score):
|
||||
"""Tasks whose attempt 0 did not give an acceptable run (score, end reason, harness error)."""
|
||||
path = os.path.join(OUT, "summary.jsonl")
|
||||
rows = [json.loads(l) for l in open(path)] if os.path.exists(path) else []
|
||||
return sorted(r["task"] for r in rows if r["attempt"] == 0 and (
|
||||
r.get("harness_error") or r.get("setup_failed") or r.get("end_reason") != "report"
|
||||
or (r.get("score") or 0) < min_score))
|
||||
|
||||
|
||||
def append(name, row):
|
||||
with LOCK, open(os.path.join(OUT, name), "a") as f:
|
||||
f.write(json.dumps(row) + "\n")
|
||||
@@ -91,7 +100,10 @@ def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("cmd", choices=["run", "list"])
|
||||
ap.add_argument("--workers", type=int, default=6)
|
||||
ap.add_argument("--attempts", type=int, default=1)
|
||||
ap.add_argument("--attempts", type=int, default=1,
|
||||
help="1 = one attempt per task; with --retry-failed: the second attempt only for failed tasks")
|
||||
ap.add_argument("--retry-failed", action="store_true")
|
||||
ap.add_argument("--min-score", type=float, default=80)
|
||||
ap.add_argument("--limit", type=int, help="maximum number of runs in this call")
|
||||
ap.add_argument("--tasks", nargs="*")
|
||||
a = ap.parse_args()
|
||||
@@ -99,6 +111,8 @@ def main():
|
||||
tasks = a.tasks or accepted_tasks()
|
||||
done = done_keys()
|
||||
todo = [(t, k) for k in range(a.attempts) for t in tasks if (t, k) not in done]
|
||||
if a.retry_failed: # attempt 1 only for tasks whose attempt 0 failed
|
||||
todo = [(t, 1) for t in failed_first_attempts(a.min_score) if t in tasks and (t, 1) not in done]
|
||||
if a.limit:
|
||||
todo = todo[:a.limit]
|
||||
print(len(tasks), "accepted tasks,", len(todo), "runs to do, spent", spent(), flush=True)
|
||||
|
||||
Reference in New Issue
Block a user