File size: 840 Bytes
8a59fc6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Run this on RunPod after uploading embeddings.npz and doc_metadata.jsonl
# Sets up the environment and runs BERTopic clustering

echo "=== RunPod BERTopic Setup ==="
echo "GPU info:"
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader

# Install dependencies
pip install --upgrade pip
pip install bertopic hdbscan umap-learn plotly safetensors

# Try to install cuML for GPU acceleration
# This depends on the CUDA version on the pod
echo ""
echo "Attempting cuML install for GPU-accelerated UMAP/HDBSCAN..."
pip install cuml-cu12 2>/dev/null || \
pip install cuml-cu11 2>/dev/null || \
echo "cuML not available — will use CPU UMAP/HDBSCAN (slower but works)"

echo ""
echo "=== Setup complete ==="
echo "Run: python 02_bertopic_gpu.py"
echo "Or with nohup: nohup python 02_bertopic_gpu.py > bertopic.log 2>&1 &"