Download scripts/packets/patch-sets-build.slurm.sh from thanminh01/WSI_Packets: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/datasets/thanminh01/WSI_Packets/resolve/main/scripts/packets/patch-sets-build.slurm.sh
- Command line
-
hf download hf://datasets/thanminh01/WSI_Packets/scripts/packets/patch-sets-build.slurm.sh
-
curl -L -o patch-sets-build.slurm.sh https://huggingface.co/datasets/thanminh01/WSI_Packets/resolve/main/scripts/packets/patch-sets-build.slurm.sh
1.6 kB
| #SBATCH --job-name=patch-sets | |
| #SBATCH -p grete:preemptible | |
| #SBATCH --requeue | |
| #SBATCH --gres=gpu:2g.20gb:1 | |
| #SBATCH -c 8 | |
| #SBATCH --mem=32G | |
| #SBATCH -t 12:00:00 | |
| #SBATCH --open-mode=append | |
| #SBATCH --output=%x-%j.out | |
| #SBATCH --error=%x-%j.err | |
| # Ranked patch sets (100 patches per slide: vector, class scores, margin, index, coordinates) for one dataset, the three patch encoders, all three scales. | |
| # The code runs on the CPU; the GPU slice is only there because the partition requires one. | |
| # usage: sbatch --export=ALL,DATASET=UBC-OCEAN patch-sets-build.slurm.sh | |
| # Finished files are skipped, so a rerun resumes. Output: $PKG/patch-sets-out/<DATASET>/. | |
| set -euo pipefail | |
| PKG="${SLURM_SUBMIT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" | |
| WS="${PROJECT_DIR:-/projects/extern/kisski/kisski-imm/dir.project}/thanm_WSI" | |
| source "${WSI_VENV:-$WS/env/WSI-Embedding}/bin/activate" | |
| export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HF_HOME="$WS/hf_cache" HF_HUB_DIR="$WS/hf_cache/hub" EMB_ROOT="$WS/embeddings" | |
| export OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 | |
| export TOP1_ROOT="${TOP1_ROOT:-$WS/embedding-acquire/hpc-search-port/packets/repo/TTA-WSI/data/packets}" | |
| DATASET="${DATASET:?set DATASET}" | |
| OUT="$PKG/patch-sets-out/$DATASET" | |
| mkdir -p "$OUT" | |
| cd "$PKG/repo" | |
| echo "start $(date '+%F %T %z') dataset $DATASET top1 root $TOP1_ROOT" | |
| for enc in conch_v1 keep musk; do | |
| echo "$(date -Is) start $enc" | |
| python -u experiments/miscellaneous/packets/patch_sets.py --encoder "$enc" --datasets "$DATASET" --out-dir "$OUT" --threads 8 | |
| echo "$(date -Is) done $enc" | |
| done | |
| echo "ALL DONE $(date '+%F %T %z')" | |