Add live MB/s and percentage progress bar for 5.9GB base checkpoint download
Browse files67 unmodified lines686970717172737473747576777879808182838485868788899091929394959697989910067 unmodified lines
# 5. Download Final Pretrained Base Checkpoint (Step 60,000, 5.9GB)base_ckpt = "checkpoints/ckpt_latest.pt"if not os.path.exists(base_ckpt):if not os.path.exists(base_ckpt) or os.path.getsize(base_ckpt) < 100 * 1024 * 1024: print("📥 Downloading base checkpoint ckpt_latest.pt from Hugging Face (~5.9GB)...") dl = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename=base_ckpt, token=HF_TOKEN) shutil.copy(dl, base_ckpt) url = f"https://huggingface.co/ViuAI/ViuAI-500M/resolve/main/{base_ckpt}" import urllib.request, time req = urllib.request.Request(url, headers={"Authorization": f"Bearer {HF_TOKEN}"}) tmp_ckpt = base_ckpt + ".tmp" with urllib.request.urlopen(req) as resp, open(tmp_ckpt, "wb") as f: total = int(resp.headers.get("Content-Length", 0)) downloaded = 0 last_t = time.time() last_mb = 0 while True: chunk = resp.read(16 * 1024 * 1024) if not chunk: break f.write(chunk) downloaded += len(chunk) cur_t = time.time() if cur_t - last_t >= 3.0: speed_mb = ((downloaded - last_mb) / (1024 * 1024)) / max(0.1, cur_t - last_t) pct = (downloaded / total * 100) if total else 0 mb = downloaded / (1024 * 1024) tot_mb = total / (1024 * 1024) print(f" ⬇️ Downloading Checkpoint: {mb:.1f} MB / {tot_mb:.1f} MB ({pct:.1f}%) @ {speed_mb:.1f} MB/s", flush=True) last_t = cur_t last_mb = downloaded os.replace(tmp_ckpt, base_ckpt)
print("✅ Base Checkpoint Ready (Step 60,000 Sub-2.0 Val Loss Pretrained Base).")
runners/RUN_QUAD_5090_SARUS_SFT.txt+26-3