Download source/scripts/make_submission.py from ajinkyamulay/analyst-workbench: direct link, hf CLI and curl.
- Browser
- Download file 1.89 kB
-
https://huggingface.co/datasets/ajinkyamulay/analyst-workbench/resolve/main/source/scripts/make_submission.py
- Command line
-
hf download hf://datasets/ajinkyamulay/analyst-workbench/source/scripts/make_submission.py
-
curl -L -o make_submission.py https://huggingface.co/datasets/ajinkyamulay/analyst-workbench/resolve/main/source/scripts/make_submission.py
1.89 kB
| """Write the arena submission body from the live /schema answer and the task list.""" | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| from urllib.request import urlopen | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from workbench.tasks import TASK_IDS # noqa: E402 | |
| LIMITS = {"split": "train", "reset_wall_s": 180, "rollout_wall_s": 1800, "verifier_wall_s": 120, | |
| "tool_wall_s": 120, "tool_calls_total": 64, "completion_tokens": 32768, | |
| "context_tokens": 32768, "memory_gib": 4, "cpu_floor_vcpus": 1, "workspace_gib": 2} | |
| def main(): | |
| p = argparse.ArgumentParser() | |
| p.add_argument("--url", default="http://127.0.0.1:18000") | |
| p.add_argument("--image", required=True) | |
| p.add_argument("--id", default="analyst-workbench-v1") | |
| p.add_argument("--out", default="submission.json") | |
| p.add_argument("--tasks", default="", help="comma-separated task ids (default: every family at level 1)") | |
| a = p.parse_args() | |
| tasks = a.tasks.split(",") if a.tasks else TASK_IDS | |
| schema = json.load(urlopen(a.url + "/schema")) | |
| body = { | |
| "submission_id": a.id, | |
| "name": "Analyst Workbench", | |
| "image": a.image, | |
| "schema": {"action": schema["action"], "observation": schema["observation"]}, | |
| "tasks": [dict(LIMITS, task_id=t, **({"verifier_wall_s": 300} if t.startswith("swe-repo-") else {})) | |
| for t in tasks], | |
| "example_actions": [{"tool": "ls"}, {"tool": "submit", "answer": ""}], | |
| "finish_action": {"tool": "submit", "answer": ""}, | |
| "dataset": "ajinkyamulay/analyst-workbench", | |
| "source": "https://huggingface.co/datasets/ajinkyamulay/analyst-workbench/tree/main/source", | |
| } | |
| Path(a.out).write_text(json.dumps(body, indent=2) + "\n") | |
| print(f"wrote {a.out}: {len(body['tasks'])} tasks, image {a.image}") | |
| if __name__ == "__main__": | |
| main() | |