Spaces:
Running on Zero
Running on Zero
Download scripts/start-linux.sh from paleocybernetic/rickroll: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/spaces/paleocybernetic/rickroll/resolve/main/scripts/start-linux.sh
- Command line
-
hf download hf://spaces/paleocybernetic/rickroll/scripts/start-linux.sh
-
curl -L -o start-linux.sh https://huggingface.co/spaces/paleocybernetic/rickroll/resolve/main/scripts/start-linux.sh
1.68 kB
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| cd "$ROOT" | |
| if ! command -v nvidia-smi >/dev/null 2>&1; then | |
| echo 'NVIDIA driver not visible. Install a compatible driver / enable WSL2 GPU passthrough.' >&2 | |
| exit 1 | |
| fi | |
| if ! nvidia-smi --query-gpu=name,memory.total --format=csv,noheader; then | |
| echo 'NVIDIA GPU preflight failed; inspect the driver and CUDA setup.' >&2 | |
| exit 1 | |
| fi | |
| if [[ ! -x "$ROOT/.venv/bin/python" ]]; then | |
| echo 'Player environment missing. Run ./scripts/install-linux.sh first.' >&2 | |
| exit 1 | |
| fi | |
| export APP_MODE="${APP_MODE:-local}" | |
| export OUTPUT_DIR="${OUTPUT_DIR:-$ROOT/outputs}" | |
| export HF_HOME="${HF_HOME:-$ROOT/.cache/huggingface}" | |
| export AITK_HOME="${AITK_HOME:-$ROOT/.vendor/ai-toolkit}" | |
| export PYTHONPATH="$AITK_HOME:$ROOT${PYTHONPATH:+:$PYTHONPATH}" | |
| export YUE2_MODEL_PATH="${YUE2_MODEL_PATH:-Comfy-Org/YuE2/checkpoints/yue2_3b_int8_convrot.safetensors}" | |
| export YUE2_ADAPTER_PATH="${YUE2_ADAPTER_PATH:-$ROOT/../AdamSponsor/r02_output/checkpoints/rickroll_yue2_r02_000000300.safetensors}" | |
| export YUE2_ADAPTER_SHA256="${YUE2_ADAPTER_SHA256:-65ad9f98fd81598f64c3a8e6ad597596045036d4b6ea4f79fe8408347a1e9079}" | |
| if [[ ! -f "$YUE2_ADAPTER_PATH" ]]; then | |
| echo "Missing r02/300 adapter: $YUE2_ADAPTER_PATH" >&2 | |
| exit 1 | |
| fi | |
| actual_hash="$(sha256sum "$YUE2_ADAPTER_PATH" | cut -d ' ' -f 1)" | |
| if [[ "$actual_hash" != "$YUE2_ADAPTER_SHA256" ]]; then | |
| echo 'Adapter SHA-256 mismatch; refusing to start.' >&2 | |
| exit 1 | |
| fi | |
| mkdir -p "$OUTPUT_DIR" "$HF_HOME" | |
| port="${PORT:-7860}" | |
| echo "Player: http://127.0.0.1:$port" | |
| exec "$ROOT/.venv/bin/python" -m uvicorn backend.app:app --host 127.0.0.1 --port "$port" --workers 1 | |