Datasets:
Download scripts/export_harbor_tasks.py from hcltech-robotics/simrepairbench: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/datasets/hcltech-robotics/simrepairbench/resolve/main/scripts/export_harbor_tasks.py
- Command line
-
hf download hf://datasets/hcltech-robotics/simrepairbench/scripts/export_harbor_tasks.py
-
curl -L -o export_harbor_tasks.py https://huggingface.co/datasets/hcltech-robotics/simrepairbench/resolve/main/scripts/export_harbor_tasks.py
2.36 kB
| """Create Harbor definitions or complete separate-verifier task contexts.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import sys | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'src')) | |
| from simrepairbench.harbor import export_definitions, materialize, RUNTIME_IMAGE | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument('--root', type=Path, default=Path(__file__).resolve().parents[1]) | |
| parser.add_argument('--output', type=Path) | |
| parser.add_argument('--materialize', action='store_true', help='Build complete standard Harbor contexts; default writes small public definitions') | |
| parser.add_argument('--case', default='all') | |
| parser.add_argument('--requirements-root', '--requirements-dir', type=Path) | |
| parser.add_argument('--reference-root', type=Path) | |
| parser.add_argument('--damaged-root', type=Path) | |
| parser.add_argument('--evaluator-root', type=Path) | |
| parser.add_argument('--runtime-image', default=RUNTIME_IMAGE) | |
| parser.add_argument('--fetch', action='store_true', help='Fetch missing public input/source bytes on the host, checking pinned hashes') | |
| parser.add_argument('--dataset-revision', default='main') | |
| parser.add_argument('--dataset-version', default='0.3.0') | |
| parser.add_argument('--replace', action='store_true', help='Replace only an exporter-marked task directory') | |
| args = parser.parse_args() | |
| root = args.root.resolve() | |
| requirements = args.requirements_root or root / 'profiles/castaigne25' | |
| if args.materialize: | |
| output = args.output or root / 'work/harbor/tasks' | |
| rows = materialize(root, output, case_id=args.case, requirements_root=requirements, | |
| reference_root=args.reference_root, damaged_root=args.damaged_root, | |
| runtime_image=args.runtime_image, evaluator_root=args.evaluator_root, | |
| fetch=args.fetch, dataset_revision=args.dataset_revision, dataset_version=args.dataset_version, replace=args.replace) | |
| else: | |
| output = args.output or root / 'harbor/definitions' | |
| rows = export_definitions(root, output, requirements_root=requirements, evaluator_root=args.evaluator_root) | |
| print(json.dumps({'cases': len(rows), 'output': str(output), 'materialized': args.materialize})) | |
| if __name__ == '__main__': | |
| main() | |