File size: 628 Bytes
4164484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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"