File size: 1,388 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
31
32
#!/bin/bash
#SBATCH --job-name=j2_c2_run
#SBATCH --partition=ZEN4
#SBATCH --qos=nu-zen4
#SBATCH --gres=none
#SBATCH --cpus-per-task=16
#SBATCH --mem=64G
#SBATCH --time=04:00:00
#SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out
# J2 controls 2 on ZEN4 CPU: the SAME run_screen.py, prompts, batch size 16, 1x, bf16, greedy, 48 new tokens.
# usage: sbatch controls2_run_cpu.sbatch SET:MODEL [SET:MODEL ...]   with SET = stored | stretch | fonts
set -u
CODE=/path/to/TURKIC_OCR_CODE
DATA=/path/to/TURKIC_OCR_DATA
export HF_HUB_OFFLINE=1
unset HF_TOKEN HUGGING_FACE_HUB_TOKEN || true
C2=$DATA/outputs/j11_controls_2
KIMG=$DATA/data/processed/kohtd_words_raw/KOHTD_dataset/HK_dataset/img
for PAIR in "$@"; do
  SET=${PAIR%%:*}; M=${PAIR##*:}
  case $SET in
    stored)  LIST=$C2/contrast_stored_screen_set_v1.tsv;  IMG=$KIMG ;;
    stretch) LIST=$C2/contrast_stretch_screen_set_v1.tsv; IMG=$C2/img_stretch ;;
    fonts)   LIST=$C2/fonts_screen_set_v1.tsv;            IMG=$C2/img_fonts ;;
  esac
  mkdir -p $C2/out_$SET
  echo "=== $SET $M $(date -u +%H:%M:%S)"
  $CODE/.venv_vlm/bin/python -I $CODE/scripts/j2/run_screen.py $M $DATA/hf_cache/j2_models $CODE/scripts/j2/prompts.json \
    $LIST $IMG $C2/out_$SET --device cpu --threads 16 --batch-size 16 --max-new-tokens 48 --scales 1 2>&1 | grep -v -E "Loading weights|^\s*$" | tail -4
done
echo "[j2_c2_run] done $(date -u +%H:%M:%S)"