File size: 983 Bytes
d094faf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""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>")