Datasets:
File size: 979 Bytes
0160c62 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | """
Download all files for the SynthesizeAIWS25 dataset using a mainland China mirror by default.
Usage:
uv run python scripts/download_aiws_full.py
Override endpoint (e.g., official HF) if needed:
HF_ENDPOINT=https://huggingface.co uv run python scripts/download_aiws_full.py
"""
import os
from pathlib import Path
from huggingface_hub import snapshot_download
repo_id = "tancilon/SynthesizeAIWS25"
project_root = Path(__file__).resolve().parent.parent
local_dir = project_root / "data" / "SynthesizeAIWS25"
cache_dir = project_root / ".hf_cache"
# Prefer mainland mirror; allow override via HF_ENDPOINT.
hf_endpoint = os.environ.get("HF_ENDPOINT", "https://hf-mirror.com")
local_dir.mkdir(parents=True, exist_ok=True)
cache_dir.mkdir(parents=True, exist_ok=True)
snapshot_download(
repo_id=repo_id,
repo_type="dataset",
local_dir=local_dir,
cache_dir=cache_dir,
local_dir_use_symlinks=False,
max_workers=18,
endpoint=hf_endpoint,
)
|