File size: 1,826 Bytes
24aaa76 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/bin/bash
#SBATCH --job-name=r5_vlma_evaltest
#SBATCH --partition=ZEN4
#SBATCH --qos=nu-zen4
#SBATCH --gres=none
#SBATCH --cpus-per-task=16
#SBATCH --mem=32G
#SBATCH --time=00:45:00
#SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out
# R5 VLMA: CPU test of the full validation path of eval_vlm.py (registry, refusal of locked/test sets, TSV columns,
# scores, meta) with the Granite CPU-check export, 6 rows of V1. The registry here is a TEST file: it lists V1 (val)
# and kohtd_test (locked, must be refused without being opened). No test image is read.
set -u
CODE=/path/to/TURKIC_OCR_CODE
DATA=/path/to/TURKIC_OCR_DATA
S=$CODE/scripts/r5_vlma
export HF_HUB_OFFLINE=1 TOKENIZERS_PARALLELISM=false
unset HF_TOKEN HUGGING_FACE_HUB_TOKEN || true
T=$DATA/outputs/r5/vlma/eval_test
rm -rf $T; mkdir -p $T
M=$DATA/data/processed/r5/manifests
printf '{"sets": [{"name": "V1", "manifest": "%s/kohtd_screen_v1.tsv", "split": "val", "purpose": "test of eval_vlm", "locked": false}, {"name": "V1copy", "manifest": "%s/kohtd_screen_v1.tsv", "split": "val", "purpose": "reuse test", "locked": false}, {"name": "kohtd_test", "manifest": "%s/kohtd_test.tsv", "split": "test", "purpose": "must be refused", "locked": true}]}\n' $M $M $M > $T/evalsets_test.json
$CODE/.venv_vlm/bin/python -I $S/eval_vlm.py --short granite_docling_258m --arm evaltest_granite --ckpt smoke \
--model-dir $DATA/checkpoints/r5/cpu_check/cpu_granite_docling_258m/smoke --registry $S/models_r5.tsv \
--evalsets $T/evalsets_test.json --preds-root $T/preds --batch 3 --device cpu --limit 6 2>&1 | grep -v -E "Loading weights|^\s*$" | tail -8
echo "--- files"; ls -la $T/preds/evaltest_granite/smoke/
echo "--- tsv"; cat $T/preds/evaltest_granite/smoke/V1.tsv
echo "--- meta"; head -c 2500 $T/preds/evaltest_granite/smoke/meta.json
echo "[evaltest] done"
|