From 830763c3fa97bed10fe4c04f09bf46cd04921fab Mon Sep 17 00:00:00 2001 From: Z User Date: Thu, 29 Oct 2026 23:28:28 +0000 Subject: [PATCH] fix: TTS entrypoint uses 'bash startup.sh' + correct Piper voice URLs + v0.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs fixed: 1. Entrypoint used 'python /app/app.py' but openedai-speech uses 'bash startup.sh'. Fixed to: exec bash /app/startup.sh 2. Piper voice download URLs were wrong. HuggingFace path is: ru/ru_RU//medium/ru_RU--medium.onnx (was: ru_RU//medium/...) Also added file size check — if <1000 bytes, download failed. 3. entrypoint.sh now includes all 4 Russian voices in default config: irina, denis, dmitri, ruslan After merge: git pull rm -rf gpu/tts/voices/ru_RU-* # delete broken 15-byte files sh gpu/tts/download-ru-voices.sh # re-download with correct URLs docker compose --profile tts up -d --force-recreate tts --- dashboard/src/app/api/debug/route.ts | 2 +- dashboard/src/lib/version.ts | 2 +- gpu/tts/download-ru-voices.sh | 18 +++++++++---- gpu/tts/entrypoint.sh | 40 +++++++++++----------------- 4 files changed, 30 insertions(+), 32 deletions(-) diff --git a/dashboard/src/app/api/debug/route.ts b/dashboard/src/app/api/debug/route.ts index 9bc4a92..e4c5cd7 100644 --- a/dashboard/src/app/api/debug/route.ts +++ b/dashboard/src/app/api/debug/route.ts @@ -120,7 +120,7 @@ export async function GET() { ok: envError === null, error: envError, }, - version: "0.9.0", + version: "0.9.1", timestamp: new Date().toISOString(), }); } diff --git a/dashboard/src/lib/version.ts b/dashboard/src/lib/version.ts index 71435ef..9183878 100644 --- a/dashboard/src/lib/version.ts +++ b/dashboard/src/lib/version.ts @@ -4,7 +4,7 @@ * Displayed in the footer and available via /api/debug so the user can * verify the update actually took effect. */ -export const DASHBOARD_VERSION = "0.9.0"; +export const DASHBOARD_VERSION = "0.9.1"; /** * Build timestamp — set at build time by Next.js. diff --git a/gpu/tts/download-ru-voices.sh b/gpu/tts/download-ru-voices.sh index 9952e63..e080c8e 100644 --- a/gpu/tts/download-ru-voices.sh +++ b/gpu/tts/download-ru-voices.sh @@ -2,15 +2,15 @@ # Download Russian Piper TTS voices for openedai-speech # Voices: irina (female), denis (male), dmitri (male), ruslan (male) # -# Usage: sh download-ru-voices.sh +# Usage: sh gpu/tts/download-ru-voices.sh set -e VOICES_DIR="${1:-./gpu/tts/voices}" mkdir -p "$VOICES_DIR" -# Piper voice URLs (HuggingFace) -BASE_URL="https://huggingface.co/rhasspy/piper-voices/resolve/main/ru_RU" +# Piper voice URLs (HuggingFace — note the path: ru/ru_RU//medium/) +BASE_URL="https://huggingface.co/rhasspy/piper-voices/resolve/main/ru/ru_RU" VOICES="irina denis dmitri ruslan" @@ -18,7 +18,7 @@ for voice in $VOICES; do MODEL_FILE="$VOICES_DIR/ru_RU-${voice}-medium.onnx" CONFIG_FILE="$VOICES_DIR/ru_RU-${voice}-medium.onnx.json" - if [ -f "$MODEL_FILE" ]; then + if [ -f "$MODEL_FILE" ] && [ $(stat -c%s "$MODEL_FILE" 2>/dev/null || stat -f%z "$MODEL_FILE" 2>/dev/null) -gt 1000 ]; then echo "✓ $voice already downloaded" continue fi @@ -28,7 +28,15 @@ for voice in $VOICES; do "$BASE_URL/${voice}/medium/ru_RU-${voice}-medium.onnx" curl -L -o "$CONFIG_FILE" \ "$BASE_URL/${voice}/medium/ru_RU-${voice}-medium.onnx.json" - echo "✓ $voice downloaded" + + # Check file size — if too small, download failed + SIZE=$(stat -c%s "$MODEL_FILE" 2>/dev/null || stat -f%z "$MODEL_FILE" 2>/dev/null) + if [ "$SIZE" -lt 1000 ]; then + echo "✗ $voice download failed (file too small: ${SIZE} bytes)" + rm -f "$MODEL_FILE" "$CONFIG_FILE" + exit 1 + fi + echo "✓ $voice downloaded (${SIZE} bytes)" done echo "" diff --git a/gpu/tts/entrypoint.sh b/gpu/tts/entrypoint.sh index ef1e956..7c87c0b 100644 --- a/gpu/tts/entrypoint.sh +++ b/gpu/tts/entrypoint.sh @@ -2,31 +2,18 @@ set -e # Custom entrypoint for openedai-speech -# On first run, copies the default config files into the mounted /app/config/ -# directory so they're persistent and editable. -# Then launches the original entrypoint. +# On first run, creates voice_to_speaker.yaml in /app/config/ with: +# - Piper English voices (alloy, echo, fable, onyx, nova, shimmer) +# - Piper Russian voices (irina, denis) ← for natural Russian +# - XTTS voices (alloy, echo, fable, onyx, nova, shimmer) +# Then launches the original startup script. CONFIG_DIR="/app/config" -# If config dir is empty (first run), copy defaults from the image +# If config dir is empty (first run), create default config if [ ! -f "$CONFIG_DIR/voice_to_speaker.yaml" ]; then - echo "[entrypoint] First run: copying default config files..." - # Find the default config in the image - for f in voice_to_speaker.yaml pre_process_map.yaml subttts.yaml; do - # Try common locations - for src in /app/$f /app/config/$f /defaults/$f /$f; do - if [ -f "$src" ]; then - cp "$src" "$CONFIG_DIR/$f" - echo "[entrypoint] Copied $f from $src" - break - fi - done - done - - # If voice_to_speaker.yaml still doesn't exist, create a minimal one - if [ ! -f "$CONFIG_DIR/voice_to_speaker.yaml" ]; then - echo "[entrypoint] Creating default voice_to_speaker.yaml..." - cat > "$CONFIG_DIR/voice_to_speaker.yaml" << 'YAML' + echo "[entrypoint] First run: creating voice_to_speaker.yaml..." + cat > "$CONFIG_DIR/voice_to_speaker.yaml" << 'YAML' tts-1: alloy: model: voices/en_US-amy-medium.onnx @@ -44,6 +31,10 @@ tts-1: model: voices/ru_RU-irina-medium.onnx denis: model: voices/ru_RU-denis-medium.onnx + dmitri: + model: voices/ru_RU-dmitri-medium.onnx + ruslan: + model: voices/ru_RU-ruslan-medium.onnx tts-1-hd: alloy: @@ -65,8 +56,7 @@ tts-1-hd: model: xtts speaker: voices/shimmer.wav YAML - echo "[entrypoint] Created default voice_to_speaker.yaml with Russian Piper voices (irina, denis)" - fi + echo "[entrypoint] Created voice_to_speaker.yaml with Russian Piper voices (irina, denis, dmitri, ruslan)" fi # If pre_process_map.yaml doesn't exist, create an empty one @@ -76,5 +66,5 @@ fi echo "[entrypoint] Config ready. Starting openedai-speech..." -# Run the original entrypoint/cmd -exec python /app/app.py +# Run the original startup script (openedai-speech uses: bash startup.sh) +exec bash /app/startup.sh -- 2.49.1