Download scripts/aggregate_results.py from jyliuAI/diffusion_baseline: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/jyliuAI/diffusion_baseline/resolve/main/scripts/aggregate_results.py
- Command line
-
hf download hf://jyliuAI/diffusion_baseline/scripts/aggregate_results.py
-
curl -L -o aggregate_results.py https://huggingface.co/jyliuAI/diffusion_baseline/resolve/main/scripts/aggregate_results.py
1.31 kB
| #!/usr/bin/env python | |
| """Publish strict or partial baseline summary tables.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| from dlb.aggregate import IncompleteMatrixError, aggregate | |
| def main(argv: list[str] | None = None) -> int: | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--root", type=Path, default=Path.cwd()) | |
| parser.add_argument( | |
| "--output-dir", type=Path, default=None, | |
| help="defaults to ROOT/results/summary", | |
| ) | |
| parser.add_argument("--partial", action="store_true") | |
| args = parser.parse_args(argv) | |
| root = args.root.resolve() | |
| output = (args.output_dir or root / "results/summary").resolve() | |
| try: | |
| report = aggregate( | |
| root, | |
| strict=not args.partial, | |
| partial=args.partial, | |
| output_dir=output, | |
| ) | |
| except IncompleteMatrixError as error: | |
| print(str(error)) | |
| print(f"failures={len(error.failures)}") | |
| return 1 | |
| print( | |
| f"complete={str(report.complete).lower()} " | |
| f"rows={len(report.rows)} failures={len(report.failures)} " | |
| f"unsupported={len(report.unsupported)} output={output}" | |
| ) | |
| return 0 if report.complete else 1 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |