"""Push one stage's local checkpoints to the Hub (used by the swarm workers). The trainer already uploads on a timer, but a fire-and-forget uploader can miss its last commit when a process dies or the sandbox is recycled. This is the recovery path, and it is cheap to call after every job exit. python resync_one.py speech """ import sys from pathlib import Path sys.path.insert(0, "/marimo") import omni.hub as hub stage = sys.argv[1] if len(sys.argv) > 1 else None tok = None if Path("/marimo/.hf_token").exists(): tok = Path("/marimo/.hf_token").read_text().strip() pushed = hub.resync_local_runs("hkblockchaintechnology/omni-vlm-ckpt", tok, retries=3, include_optim=True, force=True, only_stages=(stage,) if stage else None) print("resynced:", pushed)