Download code/dl_sunbird.py from Pricile/waxal2026-backup: direct link, hf CLI and curl.
- Browser
- Download file 779 Bytes
-
https://huggingface.co/Pricile/waxal2026-backup/resolve/main/code/dl_sunbird.py
- Command line
-
hf download hf://Pricile/waxal2026-backup/code/dl_sunbird.py
-
curl -L -o dl_sunbird.py https://huggingface.co/Pricile/waxal2026-backup/resolve/main/code/dl_sunbird.py
779 Bytes
| import os, requests | |
| from huggingface_hub import get_token | |
| tok=get_token(); h={"Authorization":f"Bearer {tok}"} | |
| os.makedirs("/scratch/data/urban_noise/large", exist_ok=True) | |
| base="https://huggingface.co/datasets/Sunbird/urban-noise-uganda-61k/resolve/main/large/" | |
| for i in range(6): | |
| fn=f"train-{i:05d}-of-00006.parquet" | |
| dst=f"/scratch/data/urban_noise/large/{fn}" | |
| if os.path.exists(dst) and os.path.getsize(dst)>1e6: | |
| print(f"{fn} deja la"); continue | |
| r=requests.get(base+fn, headers=h, timeout=300, stream=True, allow_redirects=True) | |
| if not r.ok: print(f"{fn} ECHEC {r.status_code}"); continue | |
| n=0 | |
| with open(dst,"wb") as f: | |
| for c in r.iter_content(1<<20): f.write(c); n+=len(c) | |
| print(f"{fn}: {n/1e6:.0f} MB") | |
| print("SUNBIRD_ALL_OK") | |