Migrated from the rl-toolkit snapshot deployed for the 2026-09-15 production run (toolkit e191cf1 plus uncommitted changes). PRIME-RL is now a submodule on dphn/prime-rl@trinity; the v0 envs, parity tests, OPD experiment, and old configs are not carried over.
26 lines
902 B
Python
26 lines
902 B
Python
"""Verify HF/W&B credentials and that the cached model matches the pinned revision."""
|
|
|
|
import os
|
|
|
|
import requests
|
|
from huggingface_hub import HfApi, hf_hub_download
|
|
|
|
MODEL = "arcee-ai/Trinity-Mini"
|
|
REVISION = "cdb81e8130815fec299cccc8f8700004b8366e1e"
|
|
|
|
api = HfApi()
|
|
print("HF account:", api.whoami()["name"], flush=True)
|
|
# Training resolves `main` offline, so a moved `main` would silently change the model.
|
|
assert api.model_info(MODEL).sha == REVISION, "Model main revision changed; pin a local path"
|
|
hf_hub_download(MODEL, "config.json")
|
|
response = requests.post(
|
|
"https://api.wandb.ai/graphql",
|
|
auth=("api", os.environ["WANDB_API_KEY"]),
|
|
json={"query": "query { viewer { username } }"},
|
|
timeout=30,
|
|
)
|
|
response.raise_for_status()
|
|
data = response.json()
|
|
assert not data.get("errors"), "W&B authentication failed"
|
|
print("W&B account:", data["data"]["viewer"]["username"], flush=True)
|