Spaces:
Sleeping
Sleeping
| """Validate and (optionally) submit an agent's output to the GraphTestbed API. | |
| Default mode is print-and-stop: the runner reports the path to the produced | |
| submission.csv but does not POST. Pass `--submit <agent-name>` to the runner | |
| to actually call the scoring API. | |
| """ | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from graphtestbed.submit import submit as gtb_submit | |
| from graphtestbed.submit import validate_submission | |
| def finalize(task: str, csv_path: Path, agent: str | None) -> None: | |
| info = validate_submission(task, csv_path) | |
| print() | |
| print(f"✓ Submission ready") | |
| print(f" file: {csv_path}") | |
| print(f" rows: {info['n_rows']}") | |
| print(f" sha256: {info['sha256'][:12]}...") | |
| if agent: | |
| gtb_submit(task, csv_path, agent, dry_run=False) | |
| else: | |
| print() | |
| print("(not submitted — pass --submit <agent-name> to POST)") | |
| print(f" manual: gtb submit {task} --file {csv_path} --agent <name>") | |