| |
| """Upload MapVGGT to a PRIVATE HuggingFace repo: code + model card + 3 checkpoints. |
| Excludes: training data (Waymo/AV2), base VGGT-Omega weights, vendored clones, logs, caches. |
| Token from $HF_TOKEN.""" |
| import os |
| from huggingface_hub import HfApi |
|
|
| REPO = os.environ.get("HF_REPO", "ChenmingWu/mapvggt") |
| TOKEN = os.environ["HF_TOKEN"] |
| ROOT = "/mnt/william" |
| CKPTS = ["mapvggt_refine_best.safetensors", "abl_base_best.safetensors", "abl_full_best.safetensors"] |
|
|
| api = HfApi(token=TOKEN) |
| api.create_repo(REPO, private=True, repo_type="model", exist_ok=True) |
| print(f"repo {REPO} (private) ready", flush=True) |
|
|
| IGNORE = ["**/__pycache__/**", "**/*.pyc", "**/*.log", "**/.pytest_cache/**"] |
| |
| for pkg in ["mapvggt", "mapgs", "mapnurec", "scripts", "configs", "tests"]: |
| p = os.path.join(ROOT, pkg) |
| if os.path.isdir(p): |
| api.upload_folder(folder_path=p, path_in_repo=pkg, repo_id=REPO, repo_type="model", |
| ignore_patterns=IGNORE) |
| print(f"uploaded {pkg}/", flush=True) |
|
|
| |
| api.upload_file(path_or_fileobj=os.path.join(ROOT, "README_MAPVGGT.md"), |
| path_in_repo="README.md", repo_id=REPO, repo_type="model") |
| for f in ["pyproject.toml", "requirements.txt", "REPRODUCE.md"]: |
| fp = os.path.join(ROOT, f) |
| if os.path.exists(fp): |
| api.upload_file(path_or_fileobj=fp, path_in_repo=f, repo_id=REPO, repo_type="model") |
| print("uploaded code + card", flush=True) |
|
|
| |
| for c in CKPTS: |
| fp = os.path.join(ROOT, "runs", c) |
| if os.path.exists(fp): |
| print(f"uploading checkpoints/{c} ({os.path.getsize(fp)/1e9:.1f}G)...", flush=True) |
| api.upload_file(path_or_fileobj=fp, path_in_repo=f"checkpoints/{c}", repo_id=REPO, repo_type="model") |
| print(f" done {c}", flush=True) |
| print(f"DONE -> https://huggingface.co/{REPO}", flush=True) |
|
|