Upload code/agentic_chat.py with huggingface_hub
Browse files115 unmodified lines116117118119120121122123124125126127128129130131132133134135136137138139140115 unmodified linesprint(f"🚀 Loading Agentic ViuAI-500M on {device.upper()}...")tokenizer = load_tokenizer(args.repo_id, token)ckpt_candidates = ["sft_checkpoints/sft_v7/sft_ckpt_final.pt","sft_checkpoints/sft_v7/sft_ckpt_latest.pt","sft_checkpoints/sft_v6/sft_ckpt_latest.pt","checkpoints/ckpt_latest.pt"]ckpt_path = Nonefor cand in ckpt_candidates:if os.path.exists(cand):ckpt_path = candbreaktry:ckpt_path = hf_hub_download(repo_id=args.repo_id, filename=cand, token=token)breakexcept Exception:continueif not ckpt_path:raise FileNotFoundError("Could not find any SFT checkpoint.")checkpoint = torch.load(ckpt_path, map_location="cpu", weights_only=False)state_dict = strip_training_prefixes(checkpoint["model"])115 unmodified lines116117118119120121122123124125126127128115 unmodified linesprint(f"🚀 Loading Agentic ViuAI-500M on {device.upper()}...")tokenizer = load_tokenizer(args.repo_id, token)try:ckpt_path = hf_hub_download(repo_id=args.repo_id, filename="sft_checkpoints/sft_v6/sft_ckpt_latest.pt", token=token)except:ckpt_path = "checkpoints/ckpt_latest_updated.pt"if not os.path.exists(ckpt_path):print("⚠️ Could not find SFT checkpoint on HF, downloading base updated local...")ckpt_path = hf_hub_download(repo_id=args.repo_id, filename="checkpoints/ckpt_latest.pt", token=token)checkpoint = torch.load(ckpt_path, map_location="cpu", weights_only=False)state_dict = strip_training_prefixes(checkpoint["model"])
code/agentic_chat.py+7-19