-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob.jobscript
More file actions
35 lines (23 loc) · 964 Bytes
/
Copy pathjob.jobscript
File metadata and controls
35 lines (23 loc) · 964 Bytes
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
35
#!/bin/bash --login
#SBATCH -t 1-0 # Wallclock time limit. 4-0 is 4 days. Max permitted is 7-0.
#SBATCH -p gpuA
#SBATCH -G 1
#SBATCH -c 4 # CPUS
module purge
module load apps/binapps/conda/miniforge3/25.9.1
module load apps/binapps/ollama/0.30.6
conda activate env
unset ROCR_VISIBLE_DEVICES
export OLLAMA_HOST=0.0.0.0:11434 # This enables you to interact with the API remotely
# Redirect Ollama output (both server and pull logs) to a separate file to keep the Slurm log clean
JOB_SUFFIX=${SLURM_JOB_ID:-local}
OLLAMA_LOG="ollama_${JOB_SUFFIX}.log"
echo "Starting Ollama server (logs redirected to ${OLLAMA_LOG})..."
ollama serve > "${OLLAMA_LOG}" 2>&1 &
# 2. Wait a few seconds for the server to spin up and load the port
sleep 10
echo "Pulling model gemma4:31b..."
ollama pull gemma4:31b >> "${OLLAMA_LOG}" 2>&1
sleep 100
python3 src/chemstractor/main.py process-all --all ./tests/corpus/problems/ --model gemma4:31b
pkill ollama