"""Push the unified-512 deliverables to HF MaybeRichard/GenSeg-Baselines (replacing the old 256 report): enhanced aggregate.py (code) + unified-512 summary.* + all metrics.json (results/). Run with the write token + the REAL HF endpoint (local env defaults to the hf-mirror download mirror, which does NOT accept authenticated writes). HF_ENDPOINT=https://huggingface.co T= python3 scripts/hf_update_unified512.py """ import os from huggingface_hub import HfApi REPO = "MaybeRichard/GenSeg-Baselines" LOCAL = "/home/richard/Documents/Code/ZJU/SegGen" api = HfApi(token=os.environ["T"], endpoint="https://huggingface.co") print("[1] code: enhanced aggregate.py") api.upload_file(path_or_fileobj=f"{LOCAL}/framework/report/aggregate.py", repo_id=REPO, repo_type="model", path_in_repo="code/framework/report/aggregate.py", commit_message="aggregate.py: unified-512 intro + per-class + Wilcoxon") print("[2] results: unified-512 summary.* + all metrics.json -> results/") api.upload_folder(folder_path=f"{LOCAL}/results/unified512", repo_id=REPO, repo_type="model", path_in_repo="results", allow_patterns=["**/metrics.json", "summary.html", "summary.csv", "summary.md", "summary.tex"], commit_message="results: unified-512 (8 methods @512, per-class + significance)") print("DONE")