#!/usr/bin/env bash # Two isolated environments: thinker (transformers 5.x) and voice (TTS/ASR/Mimi). set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) TORCH_INDEX=https://download.pytorch.org/whl/cu128 command -v python3.12 >/dev/null || { echo "python3.12 required"; exit 1; } python3.12 -m venv "$ROOT/.venv-thinker" "$ROOT/.venv-thinker/bin/pip" install -q --upgrade pip "$ROOT/.venv-thinker/bin/pip" install -q --index-url "$TORCH_INDEX" torch==2.8.0 "$ROOT/.venv-thinker/bin/pip" install -q transformers==5.23.0 peft==0.22.0 accelerate==1.16.0 tokenizers==0.23.3 safetensors==0.8.0 numpy==2.5.2 aiohttp==3.14.5 soundfile==0.14.0 librosa==1.0.1 "huggingface_hub[hf_transfer]" python3.12 -m venv "$ROOT/.venv-voice" "$ROOT/.venv-voice/bin/pip" install -q --upgrade pip "$ROOT/.venv-voice/bin/pip" install -q --index-url "$TORCH_INDEX" torch==2.8.0 torchaudio==2.8.0 "$ROOT/.venv-voice/bin/pip" install -q faster-whisper==1.2.1 transformers==4.57.3 soundfile==0.14.0 librosa==1.0.1 sphn==0.2.1 numpy==2.5.2 aiohttp==3.14.5 "$ROOT/.venv-voice/bin/pip" install -q qwen-tts==0.1.1 || echo "qwen_tts wheel unavailable: install manually" "$ROOT/.venv-thinker/bin/python" -c "import torch,transformers,peft,aiohttp;print('thinker ok',torch.__version__,transformers.__version__)" "$ROOT/.venv-voice/bin/python" -c "import torch,faster_whisper;print('voice ok',torch.__version__)" echo "Install complete. Next: scripts/download_checkpoints.sh"