turkic-ocr-code / scripts /r5_realcheck.sbatch
treoa's picture
Release 1
24aaa76
Raw History Blame Contribute Delete
1.94 kB
#!/bin/bash
#SBATCH --job-name=r5_eval_realcheck
#SBATCH --partition=ZEN4
#SBATCH --qos=nu-zen4
#SBATCH --gres=none
#SBATCH --cpus-per-task=4
#SBATCH --mem=48G
#SBATCH --time=01:00:00
#SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out
# R5 EVALCODE: runs the report cards, the leader rule (amendment 3.4 E2) and the B1/B2 selection (provisional, with the paired intervals of clarification H14) on the REAL
# validation score files into SCRATCH folders (DATA/tmp/evalcode_realcheck), to check the real checkpoint names (curve_N, short_retry, short_lm_gated, long, long2x ...) and the
# real arms_info.json and models tables. Validation only; nothing is written to DATA/outputs/r5.
C=/path/to/TURKIC_OCR_CODE
D=/path/to/TURKIC_OCR_DATA
PY=$C/.venv_kraken/bin/python
# R5_STAGE (optional): a staged copy of the code (folders src/ and scripts/) to try before a deploy, for example sbatch --export=ALL,R5_STAGE=$C/_stage_check r5_realcheck.sbatch
S=${R5_STAGE:-$C}
O=$D/tmp/evalcode_realcheck${R5_STAGE:+_stage}
rm -rf $O
mkdir -p $O
TSV=$C/scripts/r5_vlma/models_r5.tsv,$C/scripts/r5_vlmb/models_r5_vlmb.tsv
AI=""
if [ -f $D/outputs/r5/arms_info.json ]; then AI="--arms-info $D/outputs/r5/arms_info.json"; fi
date -u
echo "code under test: $S"
$PY -I $S/scripts/r5eval/report_cards.py --scores $D/outputs/r5/scores --preds $D/outputs/r5/preds --out $O/report_cards \
--models-tsv $TSV --zero-shot-tsv $C/config_r5eval/zero_shot_results.tsv --labels-rule $C/config_r5eval/r5_descriptive_labels.txt $AI
date -u
$PY -I $S/scripts/r5eval/select_leaders.py --scores $D/outputs/r5/scores --preds $D/outputs/r5/preds --out $O/leaders_selection.json --models-tsv $TSV $AI
date -u
$PY -I $S/scripts/r5eval/select_b1b2.py --scores $D/outputs/r5/scores --preds $D/outputs/r5/preds --out $O/selection.json --models-tsv $TSV --allow-short-b1 $AI
date -u
ls -la $O $O/report_cards | head -40
sacct -j $SLURM_JOB_ID --format=JobID,Elapsed,MaxRSS,State