Upload runpod/setup_runpod.sh with huggingface_hub
Browse files- runpod/setup_runpod.sh +24 -0
runpod/setup_runpod.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Run this on RunPod after uploading embeddings.npz and doc_metadata.jsonl
|
| 3 |
+
# Sets up the environment and runs BERTopic clustering
|
| 4 |
+
|
| 5 |
+
echo "=== RunPod BERTopic Setup ==="
|
| 6 |
+
echo "GPU info:"
|
| 7 |
+
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
|
| 8 |
+
|
| 9 |
+
# Install dependencies
|
| 10 |
+
pip install --upgrade pip
|
| 11 |
+
pip install bertopic hdbscan umap-learn plotly safetensors
|
| 12 |
+
|
| 13 |
+
# Try to install cuML for GPU acceleration
|
| 14 |
+
# This depends on the CUDA version on the pod
|
| 15 |
+
echo ""
|
| 16 |
+
echo "Attempting cuML install for GPU-accelerated UMAP/HDBSCAN..."
|
| 17 |
+
pip install cuml-cu12 2>/dev/null || \
|
| 18 |
+
pip install cuml-cu11 2>/dev/null || \
|
| 19 |
+
echo "cuML not available — will use CPU UMAP/HDBSCAN (slower but works)"
|
| 20 |
+
|
| 21 |
+
echo ""
|
| 22 |
+
echo "=== Setup complete ==="
|
| 23 |
+
echo "Run: python 02_bertopic_gpu.py"
|
| 24 |
+
echo "Or with nohup: nohup python 02_bertopic_gpu.py > bertopic.log 2>&1 &"
|