Download code/publish.py from Cross-Mergeability/merge-accuracy: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/Cross-Mergeability/merge-accuracy/resolve/main/code/publish.py
- Command line
-
hf download hf://datasets/Cross-Mergeability/merge-accuracy/code/publish.py
-
curl -L -o publish.py https://huggingface.co/datasets/Cross-Mergeability/merge-accuracy/resolve/main/code/publish.py
1.12 kB
| """Publish the merge-accuracy artefacts to Mergeability-2/merge-accuracy (dataset repo).""" | |
| import os, sys, glob | |
| from huggingface_hub import HfApi, create_repo | |
| R = "/root/merge-accuracy" | |
| REPO = "Mergeability-2/merge-accuracy" | |
| api = HfApi() | |
| create_repo(REPO, repo_type="dataset", exist_ok=True) | |
| files = [] | |
| for p in ["RESULTS_MERGE_ACCURACY.md"]: | |
| if os.path.exists(f"{R}/{p}"): files.append((f"{R}/{p}", p)) | |
| for p in glob.glob(f"{R}/results/*.csv") + glob.glob(f"{R}/results/*.json") + glob.glob(f"{R}/results/*.jsonl"): | |
| files.append((p, f"results/{os.path.basename(p)}")) | |
| for p in glob.glob(f"{R}/figs/*.png"): | |
| files.append((p, f"figs/{os.path.basename(p)}")) | |
| for p in ["ma_common.py", "tasks.py", "gmap.py", "chatvec_run.py", "diag_only.py", | |
| "cv_control.py", "run_pairs.py", "analyze.py", "forks.json", "pairs_r4.json"]: | |
| if os.path.exists(f"{R}/{p}"): files.append((f"{R}/{p}", f"code/{p}")) | |
| for local, path in files: | |
| api.upload_file(path_or_fileobj=local, path_in_repo=path, repo_id=REPO, repo_type="dataset") | |
| print("uploaded", path) | |
| print(f"https://huggingface.co/datasets/{REPO}") | |