Download payload/tools/progress.py from davidwdw/fa-code-task00-centre-pilot-v2-707d009387de: direct link, hf CLI and curl.
- Browser
- Download file 992 Bytes
-
https://huggingface.co/davidwdw/fa-code-task00-centre-pilot-v2-707d009387de/resolve/main/payload/tools/progress.py
- Command line
-
hf download hf://davidwdw/fa-code-task00-centre-pilot-v2-707d009387de/payload/tools/progress.py
-
curl -L -o progress.py https://huggingface.co/davidwdw/fa-code-task00-centre-pilot-v2-707d009387de/resolve/main/payload/tools/progress.py
992 Bytes
| """Report measured recovery outcomes without treating infrastructure errors as trials.""" | |
| import argparse | |
| import collections | |
| import json | |
| from pathlib import Path | |
| def summarize(root): | |
| rows = [] | |
| for path in Path(root).rglob('outcome.json'): | |
| row = json.loads(path.read_text()) | |
| rows.append(dict(path=str(path.parent), **row)) | |
| trials = [r for r in rows if r.get('status') in ('completed', 'teacher_failure')] | |
| return dict(runs=len(rows), valid_trials=len(trials), | |
| successes=sum(bool(r.get('success')) for r in trials), | |
| outcomes=dict(collections.Counter(r.get('status', 'unknown') for r in rows)), | |
| rows=[{k:r.get(k) for k in ('path','status','success','steps','error','wall_seconds')} | |
| for r in rows]) | |
| if __name__ == '__main__': | |
| p = argparse.ArgumentParser(description=__doc__) | |
| p.add_argument('runs', type=Path) | |
| a = p.parse_args() | |
| print(json.dumps(summarize(a.runs), indent=2)) | |