ci: wire wandb logging via WANDB_API_KEY secret
smoke / nanochat-smoke (push) Successful in 25s

When the secret is present, base_train --run=smoke-$run_number gets
logged to wandb (project=nanochat). Without the secret it falls
back to dummy / DummyWandb, so local runs stay offline.
This commit is contained in:
Fam Zheng
2026-05-05 22:08:13 +01:00
parent 94f115094e
commit f487ffee80
3 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -16,6 +16,13 @@ export OMP_NUM_THREADS=1
mkdir -p "$CACHE_ROOT" "$NANOCHAT_BASE_DIR"
# wandb: real run if WANDB_API_KEY is set, otherwise fall back to dummy (DummyWandb).
if [ -n "${WANDB_API_KEY:-}" ]; then
RUN_TAG=${CI_RUN_TAG:-smoke-$(date +%Y%m%d-%H%M%S)}
else
RUN_TAG=dummy
fi
if [ ! -d "$NANOCHAT_DIR" ]; then
echo "Cloning nanochat into $NANOCHAT_DIR"
git clone https://github.com/karpathy/nanochat.git "$NANOCHAT_DIR" \
@@ -60,6 +67,6 @@ time python -m scripts.base_train \
--core-metric-every=-1 \
--sample-every=25 \
--num-iterations=50 \
--run=dummy
--run="$RUN_TAG"
echo "=== smoke done ==="