Datasets:
Download codes/reconstruction/experiments/status.py from shuinb/SP-TransientBench: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/datasets/shuinb/SP-TransientBench/resolve/main/codes/reconstruction/experiments/status.py
- Command line
-
hf download hf://datasets/shuinb/SP-TransientBench/codes/reconstruction/experiments/status.py
-
curl -L -o status.py https://huggingface.co/datasets/shuinb/SP-TransientBench/resolve/main/codes/reconstruction/experiments/status.py
632 Bytes
| from collections import Counter | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| run = Path(__file__).resolve().parent / 'run_20261025' | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--run-dir', type=Path, default=run) | |
| run = parser.parse_args().run_dir.resolve() | |
| state = json.loads((run / 'state.json').read_text()) | |
| print('Jobs:', dict(Counter(job['status'] for job in state['jobs']))) | |
| for gpu, worker in state.get('workers', {}).items(): | |
| print(f'GPU {gpu}: {worker}') | |
| for job in state['jobs']: | |
| if job['status'] in ('running', 'failed'): | |
| print(job['id'], job['status'], job.get('stage'), job['work']) | |