Datasets:
Download scripts/publish.py from Cross-Mergeability/crossarch-accuracy: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/datasets/Cross-Mergeability/crossarch-accuracy/resolve/main/scripts/publish.py
- Command line
-
hf download hf://datasets/Cross-Mergeability/crossarch-accuracy/scripts/publish.py
-
curl -L -o publish.py https://huggingface.co/datasets/Cross-Mergeability/crossarch-accuracy/resolve/main/scripts/publish.py
877 Bytes
| """Incremental publish to Mergeability-2/crossarch-accuracy (dataset repo).""" | |
| import os, sys, glob | |
| from huggingface_hub import HfApi, create_repo | |
| REPO = "Mergeability-2/crossarch-accuracy" | |
| ROOT = "/root/crossarch-accuracy" | |
| api = HfApi() | |
| create_repo(REPO, repo_type="dataset", exist_ok=True) | |
| pats = ["results/*.csv", "results/*.json", "results/*.jsonl", "figures/*.png", | |
| "figures/*.pdf", "*.md", "scripts/*.py", "scripts/*.sh"] | |
| n = 0 | |
| for p in pats: | |
| for f in sorted(glob.glob(os.path.join(ROOT, p))): | |
| rel = os.path.relpath(f, ROOT) | |
| if os.path.getsize(f) > 200e6: continue | |
| try: | |
| api.upload_file(path_or_fileobj=f, path_in_repo=rel, repo_id=REPO, | |
| repo_type="dataset") | |
| n += 1 | |
| except Exception as e: | |
| print("skip", rel, repr(e)[:120]) | |
| print("uploaded", n, "files to", REPO) | |