File size: 1,732 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
33
34
#!/bin/bash
#SBATCH --job-name=r5_ref_env
#SBATCH --partition=ZEN4
#SBATCH --qos=nu-zen4
#SBATCH --gres=none
#SBATCH --cpus-per-task=8
#SBATCH --mem=24G
#SBATCH --time=01:30:00
#SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out
# R5 REF: builds the two virtual environments of the reference arms (installs wheels only; no method code runs here).
#   .venv_ref_tf     : TensorFlow 2.15.1 (last version with Keras 2) for HTR-Flor (R1)
#   .venv_ref_paddle : PaddlePaddle 3.0.0 (CUDA 12.6 build) for PaddleOCR (R2)
# No credentials are in the environment.
set -u
unset HF_TOKEN HUGGING_FACE_HUB_TOKEN
C=/path/to/TURKIC_OCR_CODE
D=/path/to/TURKIC_OCR_DATA
UV=uv
mkdir -p $D/outputs/r5/ref $D/checkpoints/r5/ref $D/data/processed/r5/ref

echo "== TF venv"
$UV venv --python 3.11 $C/.venv_ref_tf
$UV pip install --python $C/.venv_ref_tf/bin/python 'tensorflow[and-cuda]==2.15.1' 'numpy<2' opencv-python-headless editdistance tqdm
$C/.venv_ref_tf/bin/python -I -m pip --version 2>/dev/null
$UV pip freeze --python $C/.venv_ref_tf/bin/python > $D/outputs/r5/ref/pip_freeze_ref_tf.txt

echo "== Paddle venv"
$UV venv --python 3.11 $C/.venv_ref_paddle
$UV pip install --python $C/.venv_ref_paddle/bin/python 'paddlepaddle-gpu==3.0.0' --index-url https://www.paddlepaddle.org.cn/packages/stable/cu126/ --extra-index-url https://pypi.org/simple --index-strategy unsafe-best-match
$UV pip install --python $C/.venv_ref_paddle/bin/python 'numpy<2' shapely scikit-image pyclipper lmdb tqdm rapidfuzz opencv-python-headless cython Pillow pyyaml requests albumentations albucore packaging editdistance
$UV pip freeze --python $C/.venv_ref_paddle/bin/python > $D/outputs/r5/ref/pip_freeze_ref_paddle.txt
echo "== done"
nproc; free -g | head -2