| 18 | |
| 19 | |
| 20 | def _snapshot(repo_id: str, revision: str | None) -> Path: |
| 21 | try: |
| 22 | from huggingface_hub import snapshot_download |
| 23 | except ImportError as exc: # pragma: no cover - dependency check |
| 24 | raise SystemExit( |
| 25 | "huggingface_hub is required. Install with `pip install huggingface_hub`." |
| 26 | ) from exc |
| 27 | |
| 28 | return Path( |
| 29 | snapshot_download( |
| 30 | repo_id=repo_id, |
| 31 | repo_type="dataset", |
| 32 | revision=revision, |
| 33 | allow_patterns=[ |
| 34 | "data/*.jsonl", |
| 35 | "reference_outputs/*.jsonl", |
| 36 | "evaluation/*.py", |
| 37 | "README.md", |
| 38 | "VERSION", |
| 39 | ], |
| 40 | ) |
| 41 | ) |
| 42 | |
| 43 | |
| 44 | def _mirror(src: Path, dst: Path) -> None: |