Download scripts/r5_ref/ref_setup_env.sbatch from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_ref/ref_setup_env.sbatch
- Command line
-
hf download hf://treoa/turkic-ocr-code/scripts/r5_ref/ref_setup_env.sbatch
-
curl -L -o ref_setup_env.sbatch https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_ref/ref_setup_env.sbatch
1.73 kB
| #!/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 | |