Download scripts/r5_linedet/env_setup.sh from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_linedet/env_setup.sh
- Command line
-
hf download hf://treoa/turkic-ocr-code/scripts/r5_linedet/env_setup.sh
-
curl -L -o env_setup.sh https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_linedet/env_setup.sh
1.11 kB
| # R5 LINEDET: create the kraken + ultralytics uv environment (plain shell). Run on a compute node (CPU job). | |
| set -eu | |
| UV=$HOME/.local/bin/uv | |
| CODE=/path/to/TURKIC_OCR_CODE | |
| DATA=/path/to/TURKIC_OCR_DATA | |
| VENV=$CODE/.venv_kraken | |
| export UV_CACHE_DIR=$DATA/tmp/uv_cache | |
| unset HF_TOKEN HUGGING_FACE_HUB_TOKEN | |
| mkdir -p $UV_CACHE_DIR $DATA/outputs/r5/linedet | |
| $UV venv $VENV --python 3.12 | |
| # torch 2.11.0 cu128 build: same as the working .venv and .venv_vlm on the H100 nodes | |
| $UV pip install --python $VENV/bin/python --index-url https://download.pytorch.org/whl/cu128 torch==2.11.0 torchvision==0.26.0 | |
| $UV pip install --python $VENV/bin/python kraken==7.2 | |
| $UV pip install --python $VENV/bin/python ultralytics pyyaml | |
| $UV pip install --python $VENV/bin/python kenlm 2>&1 | tail -5 || echo "kenlm module did not build" | |
| $UV pip freeze --python $VENV/bin/python > $DATA/outputs/r5/linedet/pip_freeze_kraken_env.txt | |
| $UV pip list --python $VENV/bin/python | grep -i -E "^(torch|torchvision|kraken|ultralytics|lightning|pytorch-lightning|numpy|pillow|kenlm|safetensors|opencv|shapely|scikit-image) " | |
| echo "[env] done" | |