Download scripts/r5_linedet/kenlm_build.sbatch from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_linedet/kenlm_build.sbatch
- Command line
-
hf download hf://treoa/turkic-ocr-code/scripts/r5_linedet/kenlm_build.sbatch
-
curl -L -o kenlm_build.sbatch https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_linedet/kenlm_build.sbatch
1.38 kB
| #SBATCH --job-name=r5_ld_kenlm | |
| #SBATCH --partition=ZEN4 | |
| #SBATCH --qos=nu-zen4 | |
| #SBATCH --gres=none | |
| #SBATCH --cpus-per-task=8 | |
| #SBATCH --mem=16G | |
| #SBATCH --time=00:40:00 | |
| #SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out | |
| # Build lmplz and build_binary from the kenlm 0.3.0 PyPI source (sha256 pinned). No credentials in the environment. | |
| DATA=/path/to/TURKIC_OCR_DATA | |
| unset HF_TOKEN HUGGING_FACE_HUB_TOKEN | |
| export UV_CACHE_DIR=$DATA/tmp/uv_cache | |
| W=$DATA/tmp/kenlm_build | |
| mkdir -p $W && cd $W | |
| echo "node tools:"; which cmake gcc g++ make; ls /usr/include/boost 2>&1 | head -2; ls /usr/lib64 | grep -c boost | |
| $HOME/.local/bin/uv venv $W/venv --python 3.12 | |
| $HOME/.local/bin/uv pip install --python $W/venv/bin/python cmake | |
| export PATH=$W/venv/bin:$PATH | |
| which cmake; cmake --version | head -1 | |
| echo "c4628bb9fb63c8a6f9240035b8b037385cfc404cb72e933cf48878291edac1e8 $DATA/data/raw/kenlm_0_3_0_sdist/kenlm-0.3.0.tar.gz" | sha256sum -c - | |
| rm -rf src build && mkdir src && tar -xzf $DATA/data/raw/kenlm_0_3_0_sdist/kenlm-0.3.0.tar.gz -C src | |
| find src \( -name '*.cc' -o -name '*.hh' -o -name '*.h' -o -name 'CMakeLists.txt' \) | sort | xargs sha256sum > $DATA/outputs/r5/linedet/kenlm_src_sha256.txt | |
| mkdir -p build && cd build | |
| cmake ../src/kenlm-0.3.0 -DCMAKE_BUILD_TYPE=Release -DKENLM_MAX_ORDER=6 2>&1 | tail -30 | |
| make -j8 lmplz build_binary 2>&1 | tail -30 | |
| ls -la bin 2>&1 | |