mirror of
https://github.com/cactus-compute/needle.git
synced 2026-10-20 06:00:31 +08:00
- Removed GCS utilities and TPU management scripts from the codebase. - Updated project name to "cactus-needle" and version to "2.0.0" in pyproject.toml. - Simplified setup scripts for virtual environment creation and dependency installation. - Removed unnecessary dependencies from requirements.txt and setup scripts. - Enhanced compatibility with Python 3.9 and above. - Updated README and documentation references accordingly.
31 lines
741 B
Bash
Executable File
31 lines
741 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
VENV_DIR=".venv"
|
|
|
|
PYTHON=""
|
|
for candidate in python3.12 python3.11 python3.10 python3.9 python3; do
|
|
if command -v "$candidate" >/dev/null 2>&1 && \
|
|
"$candidate" -c "import sys; exit(0 if sys.version_info >= (3, 9) else 1)" 2>/dev/null; then
|
|
PYTHON="$candidate"
|
|
break
|
|
fi
|
|
done
|
|
if [ -z "$PYTHON" ]; then
|
|
echo "Python >= 3.9 is required." >&2
|
|
exit 1
|
|
fi
|
|
|
|
[ -d "$VENV_DIR" ] || "$PYTHON" -m venv "$VENV_DIR"
|
|
source "$VENV_DIR/bin/activate"
|
|
|
|
pip install --upgrade pip -q
|
|
pip install -e . -q
|
|
|
|
if command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi >/dev/null 2>&1; then
|
|
echo "NVIDIA GPU detected; installing jax[cuda12]..."
|
|
pip install -U "jax[cuda12]" -q
|
|
fi
|
|
|
|
needle --help
|