Update startup.sh
Browse files- startup.sh +26 -15
startup.sh
CHANGED
@@ -1,15 +1,26 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
set -e # Exit on error
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
export
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
set -e # Exit on error
|
3 |
+
set -x # Print commands for debugging
|
4 |
+
|
5 |
+
echo "Starting environment setup..."
|
6 |
+
|
7 |
+
# Enable device-side assertions
|
8 |
+
export TORCH_USE_CUDA_DSA=1
|
9 |
+
export CUDA_LAUNCH_BLOCKING=1
|
10 |
+
|
11 |
+
# Hugging Face cache settings (recommended)
|
12 |
+
export HF_HOME=/cache
|
13 |
+
export TRANSFORMERS_CACHE=/cache/transformers
|
14 |
+
export BITSANDBYTES_NOWELCOME=1
|
15 |
+
export HF_HUB_ENABLE_HF_TRANSFER=1
|
16 |
+
|
17 |
+
# Debugging info (before launching the model)
|
18 |
+
echo "CUDA Info:"
|
19 |
+
nvidia-smi
|
20 |
+
python -c "import torch; print('CUDA Available:', torch.cuda.is_available())"
|
21 |
+
|
22 |
+
# Upgrade bitsandbytes (before launching to avoid runtime issues)
|
23 |
+
pip install --upgrade bitsandbytes
|
24 |
+
|
25 |
+
# Start the model (this should be the last command)
|
26 |
+
exec text-generation-launcher
|