feat: Add automated install scripts for TTS/STT on Fedora
- install-stt.sh: Complete automated setup for speaches (STT) - install-voices-fr.sh: Optional French voices for Piper TTS - Both scripts handle SELinux permissions (:Z labels) - Include health checks and user-friendly output
This commit is contained in:
+131
@@ -0,0 +1,131 @@
|
||||
#!/bin/bash
|
||||
# Script d'installation STT (speaches) pour Effi sur Fedora
|
||||
# À exécuter sur folzo-Corp
|
||||
|
||||
set -e # Stop en cas d'erreur
|
||||
|
||||
echo "=========================================="
|
||||
echo "🎤 Installation STT (speaches) pour Effi"
|
||||
echo "=========================================="
|
||||
|
||||
# 1. Créer le dossier
|
||||
mkdir -p ~/speaches
|
||||
cd ~/speaches
|
||||
|
||||
# 2. Créer le docker-compose
|
||||
cat > docker-compose.yml << 'EOFDocker'
|
||||
services:
|
||||
speaches:
|
||||
image: ghcr.io/speaches-ai/speaches:latest
|
||||
container_name: speaches-stt
|
||||
restart: unless-stopped
|
||||
user: "0:0"
|
||||
ports:
|
||||
- "8200:8000"
|
||||
environment:
|
||||
- WHISPER__MODEL=deepdml/faster-whisper-large-v3-turbo-ct2
|
||||
- WHISPER__LANGUAGE=fr
|
||||
- WHISPER__COMPUTE_TYPE=int8
|
||||
- WHISPER__DEVICE=cpu
|
||||
- WHISPER__CPU_THREADS=4
|
||||
volumes:
|
||||
- speaches-models:/home/user/.cache/huggingface:Z
|
||||
|
||||
speaches-init:
|
||||
image: curlimages/curl:latest
|
||||
container_name: speaches-init
|
||||
restart: "no"
|
||||
depends_on:
|
||||
- speaches
|
||||
entrypoint: >
|
||||
sh -c "echo 'Attente du démarrage de speaches...' &&
|
||||
sleep 15 &&
|
||||
curl -sf -X POST http://speaches:8000/v1/models
|
||||
-H 'Content-Type: application/json'
|
||||
-d '{\"model\":\"deepdml/faster-whisper-large-v3-turbo-ct2\"}' &&
|
||||
echo ' ✅ Modèle enregistré' ||
|
||||
echo ' ⚠️ Erreur - vérifier manuellement'"
|
||||
|
||||
volumes:
|
||||
speaches-models:
|
||||
EOFDocker
|
||||
|
||||
echo "✅ Docker compose créé"
|
||||
|
||||
# 3. Lancer le service
|
||||
echo "🚀 Démarrage de speaches..."
|
||||
sudo docker compose up -d
|
||||
|
||||
# 4. Attendre et monitorer
|
||||
echo "⏳ Téléchargement du modèle Whisper (~1.5GB, peut prendre 5-10 min)..."
|
||||
echo " Appuyez sur Ctrl+C pour arrêter l'affichage (le téléchargement continue)"
|
||||
sleep 5
|
||||
|
||||
# Afficher les logs en temps réel pendant 60 secondes ou jusqu'à ce que ce soit prisudo timeout 60 docker logs -f speaches-stt 2>&1 || true
|
||||
|
||||
echo ""
|
||||
echo "⏳ Attente supplémentaire pour le téléchargement..."
|
||||
sleep 30
|
||||
|
||||
# 5. Vérifier l'état
|
||||
echo ""
|
||||
echo "🔍 Vérification du service..."
|
||||
if sudo docker ps | grep -q "speaches-stt"; then
|
||||
echo "✅ Container speaches-stt tourne"
|
||||
else
|
||||
echo "❌ Container speaches-stt ne tourne pas"
|
||||
sudo docker logs speaches-stt --tail 20
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 6. Vérifier le modèle
|
||||
echo ""
|
||||
echo "🔍 Vérification du modèle..."
|
||||
sleep 5
|
||||
if curl -s http://localhost:8200/v1/models | grep -q "faster-whisper"; then
|
||||
echo "✅ Modèle Whisper bien enregistré"
|
||||
else
|
||||
echo "⚠️ Modèle non enregistré automatiquement, enregistrement manuel..."
|
||||
curl -X POST http://localhost:8200/v1/models
|
||||
-H "Content-Type: application/json"
|
||||
-d '{"model":"deepdml/faster-whisper-large-v3-turbo-ct2"}' || echo "⚠️ Échec enregistrement"
|
||||
fi
|
||||
|
||||
# 7. Test rapide
|
||||
echo ""
|
||||
echo "🧪 Test du service..."
|
||||
curl -s http://localhost:8200/health && echo " ✅ Health OK" || echo " ❌ Health FAILED"
|
||||
|
||||
# 8. Récapitulatif
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "✅ INSTALLATION STT TERMINÉE !"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "📊 Services actifs sur folzo-Corp :"
|
||||
echo " • TTS (openedai-speech) : http://localhost:8100"
|
||||
echo " • STT (speaches) : http://localhost:8200"
|
||||
echo ""
|
||||
echo "📝 Prochaines étapes :"
|
||||
echo " 1. Sur effi-server, configurer Open WebUI :"
|
||||
echo " Admin Panel → Settings → Audio"
|
||||
echo ""
|
||||
echo " STT :"
|
||||
echo " Engine : OpenAI"
|
||||
echo " URL : http://192.168.1.11:8200/v1"
|
||||
echo " Model : deepdml/faster-whisper-large-v3-turbo-ct2"
|
||||
echo ""
|
||||
echo " TTS :"
|
||||
echo " Engine : OpenAI"
|
||||
echo " URL : http://192.168.1.11:8100/v1"
|
||||
echo " Model : tts-1"
|
||||
echo " Voice : alloy (anglais) ou tts-1-hd + nova (si WAV dispo)"
|
||||
echo ""
|
||||
echo " 2. Tester dans Open WebUI avec le micro 🎤"
|
||||
echo ""
|
||||
echo "🔧 Commandes utiles :"
|
||||
echo " • Logs TTS : sudo docker logs -f openedai-speech"
|
||||
echo " • Logs STT : sudo docker logs -f speaches-stt"
|
||||
echo " • Restart : sudo docker compose -f ~/openedai-speech/docker-compose.yml restart"
|
||||
echo " sudo docker compose -f ~/speaches/docker-compose.yml restart"
|
||||
echo ""
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Script optionnel : Télécharger les voix Piper en FRANÇAIS
|
||||
# À exécuter si tu veux du TTS en français (sinon c'est en anglais)
|
||||
|
||||
echo "=========================================="
|
||||
echo "🇫🇷 Téléchargement voix FRANÇAISES Piper"
|
||||
echo "=========================================="
|
||||
|
||||
cd ~/openedai-speech/tts-voices
|
||||
|
||||
# Télécharger modèles français
|
||||
echo "Téléchargement voix française (Siwis - femme)..."
|
||||
wget -q --show-progress https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/fr/fr_FR/siwis/medium/fr_FR-siwis-medium.onnx || echo "⚠️ Échec téléchargement"
|
||||
wget -q --show-progress https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/fr/fr_FR/siwis/medium/fr_FR-siwis-medium.onnx.json || echo "⚠️ Échec téléchargement"
|
||||
|
||||
# Télécharger voix masculine française
|
||||
echo "Téléchargement voix masculine française (Gilles)..."
|
||||
wget -q --show-progress https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/fr/fr_FR/gilles/medium/fr_FR-gilles-medium.onnx || echo "⚠️ Échec téléchargement"
|
||||
wget -q --show-progress https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/fr/fr_FR/gilles/medium/fr_FR-gilles-medium.onnx.json || echo "⚠️ Échec téléchargement"
|
||||
|
||||
echo "✅ Voix françaises téléchargées"
|
||||
echo ""
|
||||
echo "⚠️ IMPORTANT : Modifier le fichier ~/openedai-speech/tts-config/voice_to_speaker.yaml"
|
||||
echo " pour ajouter les voix françaises, puis redémarrer :"
|
||||
echo " sudo docker compose -f ~/openedai-speech/docker-compose.yml restart"
|
||||
Reference in New Issue
Block a user