ops: launcher fixes — uv python 3.12 pin, cu126 index (torch>=2.6), port default 8484, pip_into helper
deploy-railway / relay (push) Skipped
deploy-railway / relay (push) Skipped
This commit is contained in:
1 parent
bbfcdd5480
commit
15b631f33f
1 file changed
+18
-4
@@ -12,7 +12,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
PORT="${CHAMBER_PORT:-8000}"
|
PORT="${CHAMBER_PORT:-8484}"
|
||||||
HOST="${CHAMBER_HOST:-127.0.0.1}"
|
HOST="${CHAMBER_HOST:-127.0.0.1}"
|
||||||
DEVICE="auto"
|
DEVICE="auto"
|
||||||
|
|
||||||
@@ -31,20 +31,34 @@ PIDFILE=".chamber.pid"
|
|||||||
|
|
||||||
have_nvidia() { command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi -L >/dev/null 2>&1; }
|
have_nvidia() { command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi -L >/dev/null 2>&1; }
|
||||||
|
|
||||||
|
pip_into() {
|
||||||
|
if command -v uv >/dev/null 2>&1; then
|
||||||
|
uv pip install --quiet --python .venv/bin/python "$@"
|
||||||
|
else
|
||||||
|
.venv/bin/pip install --quiet "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
install_venv() {
|
install_venv() {
|
||||||
if [[ ! -x .venv/bin/python ]]; then
|
if [[ ! -x .venv/bin/python ]]; then
|
||||||
|
# torch has no wheels for bleeding-edge pythons; prefer uv-pinned 3.12
|
||||||
|
if command -v uv >/dev/null 2>&1; then
|
||||||
|
echo "[chamber] uv found -> venv with python 3.12"
|
||||||
|
uv venv --python 3.12 .venv
|
||||||
|
else
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
|
fi
|
||||||
echo "[chamber] venv created"
|
echo "[chamber] venv created"
|
||||||
fi
|
fi
|
||||||
if have_nvidia && [[ "$DEVICE" != "cpu" ]]; then
|
if have_nvidia && [[ "$DEVICE" != "cpu" ]]; then
|
||||||
echo "[chamber] NVIDIA detected -> installing CUDA torch (big download)"
|
echo "[chamber] NVIDIA detected -> installing CUDA torch (big download)"
|
||||||
.venv/bin/pip install --quiet "torch" --index-url https://download.pytorch.org/whl/cu121
|
pip_into "torch" --index-url https://download.pytorch.org/whl/cu126
|
||||||
else
|
else
|
||||||
echo "[chamber] CPU mode -> installing CPU torch"
|
echo "[chamber] CPU mode -> installing CPU torch"
|
||||||
.venv/bin/pip install --quiet "torch" --index-url https://download.pytorch.org/whl/cpu
|
pip_into "torch" --index-url https://download.pytorch.org/whl/cpu
|
||||||
fi
|
fi
|
||||||
# requirements.txt pins cpu-index torch on its own line; install the rest
|
# requirements.txt pins cpu-index torch on its own line; install the rest
|
||||||
grep -v '^torch' live/requirements.txt | .venv/bin/pip install --quiet -r /dev/stdin
|
grep -v '^torch' live/requirements.txt | pip_into -r /dev/stdin
|
||||||
echo "[chamber] deps installed"
|
echo "[chamber] deps installed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user