Datasets:
Download extract.py from yomi-chen/EditableDesignBench_result: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/datasets/yomi-chen/EditableDesignBench_result/resolve/main/extract.py
- Command line
-
hf download hf://datasets/yomi-chen/EditableDesignBench_result/extract.py
-
curl -L -o extract.py https://huggingface.co/datasets/yomi-chen/EditableDesignBench_result/resolve/main/extract.py
543 Bytes
| """Extract downloaded result archives into this directory.""" | |
| from pathlib import Path | |
| import zipfile | |
| root=Path(__file__).resolve().parent | |
| for archive in sorted((root/'archives').glob('*.zip')): | |
| print('Extracting',archive.name,flush=True) | |
| with zipfile.ZipFile(archive) as z: | |
| for member in z.infolist(): | |
| target=(root/member.filename).resolve() | |
| if not target.is_relative_to(root):raise ValueError('Unsafe archive path') | |
| z.extractall(root) | |
| print('Done. See predictions_index.jsonl and README.md.') | |