diff --git a/install.sh b/install.sh index 07be64269..ca7de7387 100755 --- a/install.sh +++ b/install.sh @@ -322,7 +322,7 @@ step_polkit_rules() { } step_voice_install() { - apt-get install -y -qq espeak-ng libsndfile1 + apt-get install -y -qq espeak-ng libsndfile1 cmake build-essential bash "$PROJECT_DIR/scripts/install-voice.sh" echo " Voice pipeline installed" bash "$PROJECT_DIR/scripts/setup-optimizations.sh" diff --git a/scripts/install-voice.sh b/scripts/install-voice.sh index dd7e331d0..64387aa4d 100755 --- a/scripts/install-voice.sh +++ b/scripts/install-voice.sh @@ -89,11 +89,21 @@ fi # ── Step 4: Install Kokoro TTS ─────────────────────────────────────────────── echo "[4/7] Installing Kokoro TTS..." -su - "$CLAWBOX_USER" -c "$PIP install --user 'numpy<2' 'transformers<5' kokoro soundfile Pillow" 2>&1 | tail -3 +# Install kokoro first, then force transformers<5 as a separate step. +# pip 22's resolver won't downgrade huggingface-hub (pulled in by faster-whisper) +# to satisfy transformers<5 in a single command, so it silently picks transformers 5.x. +su - "$CLAWBOX_USER" -c "$PIP install --user 'numpy<2' kokoro soundfile 'Pillow>=10'" 2>&1 | tail -3 +su - "$CLAWBOX_USER" -c "$PIP install --user 'transformers<5'" 2>&1 | tail -3 # ── Step 5: Pre-download models ───────────────────────────────────────────── echo "[5/7] Pre-downloading Whisper model (base)..." +# Clear corrupted cache (0-byte blobs from failed/rate-limited HF downloads) +WHISPER_CACHE="$CLAWBOX_HOME/.cache/huggingface/hub/models--Systran--faster-whisper-base" +if [ -d "$WHISPER_CACHE/blobs" ] && find "$WHISPER_CACHE/blobs" -maxdepth 1 -type f -empty | grep -q .; then + echo " Clearing corrupted Whisper model cache..." + rm -rf "$WHISPER_CACHE" +fi DEVICE="cpu" COMPUTE="auto" if $HAS_CUDA; then