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/<voice>/medium/ru_RU-<voice>-medium.onnx (was: ru_RU/<voice>/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
48 lines
1.6 KiB
Bash
48 lines
1.6 KiB
Bash
#!/bin/sh
|
|
# Download Russian Piper TTS voices for openedai-speech
|
|
# Voices: irina (female), denis (male), dmitri (male), ruslan (male)
|
|
#
|
|
# Usage: sh gpu/tts/download-ru-voices.sh
|
|
set -e
|
|
|
|
VOICES_DIR="${1:-./gpu/tts/voices}"
|
|
|
|
mkdir -p "$VOICES_DIR"
|
|
|
|
# Piper voice URLs (HuggingFace — note the path: ru/ru_RU/<voice>/medium/)
|
|
BASE_URL="https://huggingface.co/rhasspy/piper-voices/resolve/main/ru/ru_RU"
|
|
|
|
VOICES="irina denis dmitri ruslan"
|
|
|
|
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" ] && [ $(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
|
|
|
|
echo "↓ Downloading Russian voice: $voice..."
|
|
curl -L -o "$MODEL_FILE" \
|
|
"$BASE_URL/${voice}/medium/ru_RU-${voice}-medium.onnx"
|
|
curl -L -o "$CONFIG_FILE" \
|
|
"$BASE_URL/${voice}/medium/ru_RU-${voice}-medium.onnx.json"
|
|
|
|
# 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 ""
|
|
echo "Russian voices downloaded to: $VOICES_DIR"
|
|
echo "Available voices: irina (female), denis (male), dmitri (male), ruslan (male)"
|
|
echo ""
|
|
echo "These are Piper voices — use with model 'tts-1' (not 'tts-1-hd')."
|
|
echo "Restart TTS container for voices to be picked up."
|