turkic-ocr-code / scripts /r5_linedet /ext_selftest.sh
treoa's picture
Release 1
24aaa76
Raw History Blame Contribute Delete
1.25 kB
#!/bin/bash
# Self-test of the extension mode (amendment 3.4 E5) on the KOHTD smoke data with arm A3 on CPU: (1) the sample target comes first, (2) the time budget comes first.
set -u
DATA=/path/to/TURKIC_OCR_DATA
LD=$DATA/outputs/r5/linedet
PY=/path/to/TURKIC_OCR_CODE/.venv_kraken/bin/python
SM=$DATA/data/processed/r5_linedet_smoke
T=$DATA/tmp/extselftest
rm -rf $T; mkdir -p $T
unset HF_TOKEN HUGGING_FACE_HUB_TOKEN
for CASE in samples time; do
if [ $CASE = samples ]; then TGT=8320; MS=600; else TGT=1000000; MS=100; fi
echo "== case $CASE (extend_to $TGT, max_seconds $MS)"
$PY -I -m linedet.train_arm --arm A3 --mix $SM/smoke_mix.yaml --codec $LD/smoke/codec_union.json --seed 1 --workers 2 --device cpu --log_every 5 \
--resume_from $LD/smoke_gpu3/ckpt/A3/resume.pt --extend_to $TGT --ext_peak_lr 5e-4 --max_seconds $MS --ckpt_dir $T/$CASE --log_dir $T/$CASE/logs 2>&1 | grep -a -E "extension|\"saved\"|resumed|Error|Traceback" | cut -c1-260
ls $T/$CASE/A3
grep -a "\"event\": \"step\"" $T/$CASE/logs/A3.jsonl | /usr/bin/head -3 | cut -c1-120
grep -a "\"event\": \"step\"" $T/$CASE/logs/A3.jsonl | /usr/bin/tail -2 | cut -c1-120
done
echo "== source resume.pt untouched:"; ls -la $LD/smoke_gpu3/ckpt/A3/resume.pt | cut -c25-90