Spaces:
Running on Zero
Running on Zero
chore: add setup.sh with mac vs cuda branching
Browse files
setup.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
if [ ! -d .venv ]; then
|
| 5 |
+
echo "Creating .venv (Python 3.11)…"
|
| 6 |
+
python3.11 -m venv .venv
|
| 7 |
+
fi
|
| 8 |
+
|
| 9 |
+
source .venv/bin/activate
|
| 10 |
+
python -m pip install --upgrade pip
|
| 11 |
+
|
| 12 |
+
if [[ "$(uname)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
|
| 13 |
+
echo "Apple Silicon detected — installing Mac requirements"
|
| 14 |
+
pip install -r requirements.txt -r requirements-mac.txt
|
| 15 |
+
else
|
| 16 |
+
echo "Non-Mac platform — installing CUDA-path requirements"
|
| 17 |
+
pip install -r requirements.txt
|
| 18 |
+
fi
|
| 19 |
+
|
| 20 |
+
echo "Setup complete. Activate with: source .venv/bin/activate"
|