Download task_026/tests/validate_outputs.py from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_026/tests/validate_outputs.py
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_026/tests/validate_outputs.py
-
curl -L -o validate_outputs.py https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_026/tests/validate_outputs.py
669 Bytes
| """Validate output presence and per-record half-up rounding without rerunning helpers.""" | |
| import csv | |
| import math | |
| from pathlib import Path | |
| for name in ('boston_clean.csv', 'titanic_clean.csv', 'report.html'): | |
| assert Path(name).is_file() and Path(name).stat().st_size, f'missing {name}' | |
| with Path('boston_clean.csv').open(encoding='utf-8-sig', newline='') as source: | |
| rows = list(csv.DictReader(source)) | |
| assert rows, 'empty Boston output' | |
| for row in rows: | |
| assert float(row['rm_rounded']) == math.floor(float(row['rm']) + .5), 'incorrect half-up room rounding' | |
| assert Path('/logs/verifier/candidate.log').read_text().strip(), 'missing processing progress log' | |