File size: 1,691 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
#!/bin/bash
# R5 VLMA: GPU test of the full validation path of eval_vlm.py, run as a step inside the idle slot V job 50942
# (srun --jobid=50942 --overlap). Model: the Granite CPU-check export. Registry: a TEST file listing V1 (val),
# V1copy (same manifest: tests reuse) and kohtd_test (locked: must be refused without being opened). 8 rows per set.
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_gpu
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", "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 16 --device cuda --limit 8 2>&1 | grep -v -E "Loading weights|^\s*$" | tail -8
echo "--- files"; ls $T/preds/evaltest_granite/smoke/
echo "--- V1.tsv"; cat $T/preds/evaltest_granite/smoke/V1.tsv
echo "--- V1copy.tsv rows"; wc -l < $T/preds/evaltest_granite/smoke/V1copy.tsv
echo "--- meta"; head -c 3000 $T/preds/evaltest_granite/smoke/meta.json
echo "[evaltest_gpu] done"