shadow-assistant-data / math /anneal /code /anneal_build.sh
QLNI's picture
SHADOW Assistant data
362b32d
Raw History Blame Contribute Delete
1.2 kB
#!/bin/bash
# Anneal maths (SK 2026-10-23): after the SFT build ends, tokenise the anneal sources into math/anneal/<source> of the
# public repo with prep_text.py (same shard format as all text), then put this code in math/anneal/code/.
cd ~/pipe
while pgrep -f "python sft_build.py" > /dev/null; do sleep 300; done
echo "$(date +%H:%M) SFT build finished, anneal starts"
export OMP_NUM_THREADS=1 RAYON_RS_NUM_CPUS=1
for s in anneal_gsm8k anneal_dolmino_synth anneal_codesearchnet anneal_tulu_math anneal_megamath_qa anneal_mathcoder2; do
echo "$(date +%H:%M) start $s"
nice -n 10 ~/venv/bin/python prep_text.py --source $s --workers 12 --out /data/anneal_out > /data/logs/anneal_$s.log 2>&1 || echo "FAILED $s"
grep -E "DONE|total|uploaded" /data/logs/anneal_$s.log | tail -2
done
~/venv/bin/python - <<'PY'
from huggingface_hub import HfApi, CommitOperationAdd
ops = [CommitOperationAdd(path_in_repo=f"math/anneal/code/{f}", path_or_fileobj=f) for f in ("prep_text.py", "anneal_build.sh")]
HfApi().create_commit(repo_id="QLNI/shadow-assistant-data", repo_type="dataset", operations=ops, commit_message="Add anneal build code")
print("code uploaded")
PY
echo "$(date +%H:%M) ANNEAL DONE"