File size: 1,346 Bytes
5189638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if ! command -v python3.12 >/dev/null 2>&1 || ! command -v git >/dev/null 2>&1; then
  echo 'Install Python 3.12 and git before setup.' >&2
  exit 1
fi
if ! command -v nvidia-smi >/dev/null 2>&1; then
  echo 'NVIDIA GPU/driver is required; on Windows use a WSL2 CUDA-compatible driver.' >&2
  exit 1
fi
if ! command -v ffmpeg >/dev/null 2>&1; then
  echo 'Install ffmpeg before setup; AI Toolkit uses it for audio.' >&2
  exit 1
fi

AITK_HOME="${AITK_HOME:-$ROOT/.vendor/ai-toolkit}"
AITK_COMMIT="${AITK_COMMIT:-31ddc709c35d3d3b820c636745397561f806b246}"
if [[ ! -d "$AITK_HOME/.git" ]]; then
  mkdir -p "$(dirname "$AITK_HOME")"
  git clone https://github.com/ostris/ai-toolkit.git "$AITK_HOME"
fi
git -C "$AITK_HOME" fetch origin "$AITK_COMMIT"
git -C "$AITK_HOME" checkout --detach "$AITK_COMMIT"
python3.12 -m venv "$ROOT/.venv"
"$ROOT/.venv/bin/python" -m pip install --upgrade pip
"$ROOT/.venv/bin/python" -m pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu130
"$ROOT/.venv/bin/python" -m pip install -r "$AITK_HOME/requirements.txt"
"$ROOT/.venv/bin/python" -m pip install "$ROOT"
echo "Installed AI Toolkit at $AITK_HOME and player at $ROOT/.venv"
echo 'Run AITK_HOME=<path above> ./scripts/start-linux.sh'