#!/usr/bin/env bash set -euo pipefail APP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" VENV_DIR="${AUDEX_VENV_DIR:-$APP_DIR/.venv}" PYTHON="$VENV_DIR/bin/python" if [[ ! -x "$PYTHON" ]]; then python3 -m venv "$VENV_DIR" fi "$PYTHON" -m pip install --upgrade pip if ! "$PYTHON" -c "import torch" >/dev/null 2>&1; then "$PYTHON" -m pip install "${AUDEX_TORCH_PACKAGE:-torch}" fi "$PYTHON" -m pip install \ --requirement "$APP_DIR/requirements.txt" \ "gradio==6.20.0" \ "huggingface_hub" \ "spaces>=0.51.0" echo "Local environment ready: $VENV_DIR" echo "Launch with: bash $APP_DIR/run_local.sh"