File size: 1,120 Bytes
70509c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
# 00_setup_cpu.sh — RunPod CPU-Pod (16 vCPU / 64 GB RAM / 100 GB Disk)
# Alles auf /root (Container Disk), NICHT auf /workspace (Quota-Limit).
set -e

export HF_HOME=/root/hf
mkdir -p /root/hf /root/train

python -m venv /root/venv
source /root/venv/bin/activate
pip install -U pip

# CPU-Torch (kein CUDA-Wheel — spart ~2.5 GB Download)
pip install torch --index-url https://download.pytorch.org/whl/cpu

# KEIN optimum installieren: zieht transformers<4.58 und bricht Gemma 4.
pip install "transformers>=5.13" accelerate safetensors sentencepiece pillow
pip install onnx onnxruntime numpy

# Threads auf die 16 Cores setzen
export OMP_NUM_THREADS=16
echo 'export OMP_NUM_THREADS=16' >> /root/venv/bin/activate
echo 'export HF_HOME=/root/hf'   >> /root/venv/bin/activate

df -h /root
free -g
python - <<'PY'
import torch, transformers, onnx, onnxruntime
print("torch        ", torch.__version__)
print("transformers ", transformers.__version__)
print("onnx         ", onnx.__version__)
print("onnxruntime  ", onnxruntime.__version__)   # <-- diese Zeile brauche ich!
PY
echo "--- Setup fertig."