Download scripts/r5_release/rc1_prep.sbatch from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 3.32 kB
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_release/rc1_prep.sbatch
- Command line
-
hf download hf://treoa/turkic-ocr-code/scripts/r5_release/rc1_prep.sbatch
-
curl -L -o rc1_prep.sbatch https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_release/rc1_prep.sbatch
3.32 kB
| #SBATCH --job-name=rc1_prep | |
| #SBATCH --partition=ZEN4 | |
| #SBATCH --cpus-per-task=8 | |
| #SBATCH --mem=32G | |
| #SBATCH --time=01:00:00 | |
| #SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out | |
| # Release candidate 1, prep job: copy the weights into DATA/release/rc1/<package>/, byte-compare every copy with its source, | |
| # convert the A1 checkpoint to safetensors + codec JSON, count parameters, freeze the two venvs, scan the detector's page lists. | |
| # Nothing is uploaded anywhere. Validation / training lists only; no locked test file is opened. | |
| set -u | |
| CODE=/path/to/TURKIC_OCR_CODE | |
| D=/path/to/TURKIC_OCR_DATA | |
| R=$D/release/rc1 | |
| W=$D/tmp/rc1_check | |
| UV=uv | |
| SC=$CODE/scripts/r5_release | |
| P1=$R/turkic-ocr-paddleocr-vl-1.6 | |
| P2=$R/turkic-ocr-qwen3-vl-2b | |
| P3=$R/turkic-ocr-ppocrv6-medium | |
| P4=$R/turkic-line-detector-yolo11s | |
| P5=$R/page-pipeline | |
| unset HF_TOKEN HUGGING_FACE_HUB_TOKEN | |
| export PYTHONDONTWRITEBYTECODE=1 HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 YOLO_OFFLINE=1 | |
| echo "job $SLURM_JOB_ID host $(hostname) start $(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
| mkdir -p $P1/model $P2/model $P3/model $P3/lm $P4 $P5 $W | |
| echo "== copy" | |
| cp $D/checkpoints/r5/paddleocr_vl_1_6/leader/* $P1/model/ | |
| cp $D/checkpoints/r5/qwen3_vl_2b/leader/* $P2/model/ | |
| cp $D/outputs/r5/linedet/lm/char6.klm $P3/lm/char6.klm | |
| cp $D/checkpoints/r5/linedet/detectors/yolo_s2/weights/best.pt $P4/best.pt | |
| chmod -R a+rX $R | |
| echo "== byte compare copies with sources (cmp)" | |
| for f in $D/checkpoints/r5/paddleocr_vl_1_6/leader/*; do cmp "$f" "$P1/model/$(basename $f)" && echo "SAME paddle $(basename $f)"; done | |
| for f in $D/checkpoints/r5/qwen3_vl_2b/leader/*; do cmp "$f" "$P2/model/$(basename $f)" && echo "SAME qwen $(basename $f)"; done | |
| cmp $D/outputs/r5/linedet/lm/char6.klm $P3/lm/char6.klm && echo "SAME char6.klm" | |
| cmp $D/checkpoints/r5/linedet/detectors/yolo_s2/weights/best.pt $P4/best.pt && echo "SAME best.pt" | |
| echo "== sha256 of sources" | |
| sha256sum $D/checkpoints/r5/paddleocr_vl_1_6/leader/model.safetensors $D/checkpoints/r5/qwen3_vl_2b/leader/model.safetensors \ | |
| $D/checkpoints/r5/linedet_ext/A1/long2x.pt $D/outputs/r5/linedet/lm/char6.klm $D/checkpoints/r5/linedet/detectors/yolo_s2/weights/best.pt \ | |
| $D/data/raw/zenodo_ppocrv6_medium_21788410/medium.safetensors | |
| echo "recorded char6 sha256 file:"; cat $D/outputs/r5/linedet/lm/char6.sha256 | |
| echo "== A1 checkpoint -> safetensors + codec" | |
| $CODE/.venv_kraken/bin/python -I $SC/rc1_prep_a1.py $D/checkpoints/r5/linedet_ext/A1/long2x.pt $P3/model $D/outputs/r5/linedet/codec_union.json $W/prep_a1.json | |
| echo "exit $?" | |
| echo "== VLM parameter counts" | |
| $CODE/.venv_vlm/bin/python -I $SC/rc1_prep_vlm.py $W/prep_vlm.json $P1/model $P2/model | |
| echo "exit $?" | |
| echo "== detector page lists" | |
| P=$D/data/processed/r5_linedet_det | |
| $CODE/.venv_kraken/bin/python -I $SC/rc1_prep_misc.py $W/prep_pages.json $P/gen/pages_gen_train.tsv $P/gen/pages_gen_val.tsv $P/school2/pages_school_train.tsv $P/school2/pages_school_val.tsv $P/school2/school_build_summary.json | |
| echo "exit $?" | |
| echo "== freeze" | |
| $UV pip freeze --python $CODE/.venv_vlm/bin/python > $W/freeze_vlm.txt | |
| echo "vlm freeze exit $?" | |
| $UV pip freeze --python $CODE/.venv_kraken/bin/python > $W/freeze_kraken.txt | |
| echo "kraken freeze exit $?" | |
| $CODE/.venv_vlm/bin/python --version | |
| $CODE/.venv_kraken/bin/python --version | |
| chmod -R a+rX $R | |
| echo "end $(date -u +%Y-%m-%dT%H:%M:%SZ)" | |