docs: Add detailed guide for TTS/STT installation on Fedora
- Complete installation plan for openedai-speech (TTS) on folzo-Corp - Complete installation plan for speaches (STT) on folzo-Corp - Docker compose configurations for both services - Testing procedures and troubleshooting - Phase breakdown with current status (Phase 1 complete)
This commit is contained in:
@@ -0,0 +1,425 @@
|
|||||||
|
# 🎙️ Plan Détaillé : Voix et Ouïe pour Effi sur Fedora
|
||||||
|
|
||||||
|
> **Document de référence** - Installation TTS/STT sur folzo-Corp (Fedora)
|
||||||
|
> **Date** : Avril 2026
|
||||||
|
> **Statut** : En cours
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Vue d'ensemble
|
||||||
|
|
||||||
|
```bash
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ FOLZO-CORP (Fedora) │
|
||||||
|
│ ┌─────────────────────────────────────────────────────────┐ │
|
||||||
|
│ │ 1. openedai-speech (TTS) │ │
|
||||||
|
│ │ - Port: 8100 │ │
|
||||||
|
│ │ - GPU: ROCm (RX 7800 XT) │ │
|
||||||
|
│ │ - Voix: XTTS v2 (nova) │ │
|
||||||
|
│ │ │ │
|
||||||
|
│ │ 2. speaches (STT) │ │
|
||||||
|
│ │ - Port: 8200 │ │
|
||||||
|
│ │ - Modèle: Whisper large-v3-turbo │ │
|
||||||
|
│ │ - CPU (ROCm en option future) │ │
|
||||||
|
│ └─────────────────────────────────────────────────────────┘ │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ EFFI-SERVER │
|
||||||
|
│ Open WebUI (port 3000) │
|
||||||
|
│ - STT URL: http://192.168.1.11:8200/v1 │
|
||||||
|
│ - TTS URL: http://192.168.1.11:8100/v1 │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ PHASE 1 : Préparation Fedora (TERMINÉE)
|
||||||
|
|
||||||
|
### Statut
|
||||||
|
- ✅ ROCm installé et fonctionnel
|
||||||
|
- ✅ Docker v29.3.1 installé
|
||||||
|
- ✅ Firewall configuré (ports 8100, 8200, 11434 ouverts)
|
||||||
|
|
||||||
|
### Vérifications effectuées
|
||||||
|
```bash
|
||||||
|
$ docker --version
|
||||||
|
Docker version 29.3.1, build 1.fc43
|
||||||
|
|
||||||
|
$ rocm-smi
|
||||||
|
Device Node IDs Temp Power Partitions SCLK MCLK Fan Perf PwrCap VRAM% GPU%
|
||||||
|
0 1 0x747e, 60998 44.0°C 50.0W N/A, N/A, 0 169Mhz 1218Mhz 0% auto 212.0W 3% 14%
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔊 PHASE 2 : TTS (openedai-speech)
|
||||||
|
|
||||||
|
### Étape 2.1 : Créer la structure
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Se connecter à folzo-Corp (localement ou via SSH)
|
||||||
|
mkdir -p ~/openedai-speech
|
||||||
|
cd ~/openedai-speech
|
||||||
|
|
||||||
|
# Créer les sous-dossiers
|
||||||
|
mkdir -p tts-voices tts-config
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 2.2 : Docker Compose TTS
|
||||||
|
|
||||||
|
Créer le fichier `~/openedai-speech/docker-compose.yml` :
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
openedai-speech:
|
||||||
|
image: ghcr.io/matatonic/openedai-speech
|
||||||
|
container_name: openedai-speech
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8100:8000"
|
||||||
|
volumes:
|
||||||
|
- ./tts-voices:/app/voices
|
||||||
|
- ./tts-config:/app/config
|
||||||
|
devices:
|
||||||
|
- /dev/kfd
|
||||||
|
- /dev/dri
|
||||||
|
group_add:
|
||||||
|
- "44" # video
|
||||||
|
- "991" # render
|
||||||
|
environment:
|
||||||
|
- HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||||
|
- HIP_VISIBLE_DEVICES=0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 2.3 : Configuration des voix
|
||||||
|
|
||||||
|
Créer le fichier `~/openedai-speech/tts-config/voice_to_speaker.yaml` :
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Configuration XTTS v2
|
||||||
|
tts-1-hd:
|
||||||
|
alloy:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/alloy.wav
|
||||||
|
echo:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/echo.wav
|
||||||
|
fable:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/fable.wav
|
||||||
|
onyx:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/onyx.wav
|
||||||
|
nova:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/nova.wav
|
||||||
|
shimmer:
|
||||||
|
model: xtts
|
||||||
|
speaker: voices/shimmer.wav
|
||||||
|
|
||||||
|
# Fallback en piper si pas de fichier WAV
|
||||||
|
tts-1:
|
||||||
|
alloy:
|
||||||
|
model: voices/en_US-libritts_r-medium.onnx
|
||||||
|
speaker: 79
|
||||||
|
echo:
|
||||||
|
model: voices/en_US-libritts_r-medium.onnx
|
||||||
|
speaker: 134
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 2.4 : Télécharger les modèles de voix
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/openedai-speech/tts-voices
|
||||||
|
|
||||||
|
# Télécharger les modèles Piper (fallback)
|
||||||
|
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts_r/medium/en_US-libritts_r-medium.onnx
|
||||||
|
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts_r/medium/en_US-libritts_r-medium.onnx.json
|
||||||
|
|
||||||
|
# Note: Les fichiers .wav pour XTTS seront à recréer ou restaurer depuis backup
|
||||||
|
# Pour tester immédiatement, on utilisera la voix "alloy" en piper (anglais)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 2.5 : Lancer et tester
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/openedai-speech
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
# Vérifier les logs
|
||||||
|
docker logs -f openedai-speech
|
||||||
|
|
||||||
|
# Test rapide
|
||||||
|
curl -s http://localhost:8100/v1/audio/speech \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"model":"tts-1","input":"Hello, this is a test","voice":"alloy"}' \
|
||||||
|
--output /tmp/test_tts.mp3
|
||||||
|
|
||||||
|
# Vérifier le fichier
|
||||||
|
ls -lh /tmp/test_tts.mp3
|
||||||
|
file /tmp/test_tts.mp3
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎤 PHASE 3 : STT (speaches - Whisper)
|
||||||
|
|
||||||
|
### Étape 3.1 : Créer la structure
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/speaches
|
||||||
|
cd ~/speaches
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 3.2 : Dockerfile pour speaches
|
||||||
|
|
||||||
|
Créer le fichier `~/speaches/Dockerfile` :
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
||||||
|
|
||||||
|
WORKDIR /home/ubuntu/speaches
|
||||||
|
|
||||||
|
# Installation des dépendances système
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
ffmpeg \
|
||||||
|
libsndfile1 \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Créer l'utilisateur
|
||||||
|
RUN useradd --create-home --shell /bin/bash ubuntu
|
||||||
|
|
||||||
|
# Cloner speaches
|
||||||
|
RUN git clone https://github.com/speaches-ai/speaches.git .
|
||||||
|
|
||||||
|
# Installer speaches
|
||||||
|
RUN uv sync --frozen --no-dev
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
CMD [".venv/bin/python", "-m", "speaches"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 3.3 : Docker Compose STT
|
||||||
|
|
||||||
|
Créer le fichier `~/speaches/docker-compose.yml` :
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
speaches:
|
||||||
|
build: .
|
||||||
|
container_name: speaches-stt
|
||||||
|
restart: unless-stopped
|
||||||
|
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/ubuntu/.cache/huggingface
|
||||||
|
|
||||||
|
speaches-init:
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
container_name: speaches-init
|
||||||
|
restart: "no"
|
||||||
|
depends_on:
|
||||||
|
- speaches
|
||||||
|
entrypoint: >
|
||||||
|
sh -c "sleep 10 &&
|
||||||
|
curl -sf -X POST http://speaches:8000/v1/models/deepdml%2Ffaster-whisper-large-v3-turbo-ct2 &&
|
||||||
|
echo 'Modèle enregistré' || echo 'Erreur enregistrement modèle'"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
speaches-models:
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 3.4 : Builder et lancer
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/speaches
|
||||||
|
docker compose build
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
# Attendre le téléchargement du modèle (~1.5GB)
|
||||||
|
docker logs -f speaches-stt
|
||||||
|
```
|
||||||
|
|
||||||
|
### Étape 3.5 : Test STT
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Créer un fichier audio test
|
||||||
|
# ou utiliser un fichier existant
|
||||||
|
|
||||||
|
curl -s http://localhost:8200/v1/audio/transcriptions \
|
||||||
|
-F "file=@/chemin/vers/audio.wav" \
|
||||||
|
-F "model=deepdml/faster-whisper-large-v3-turbo-ct2" \
|
||||||
|
-F "language=fr"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ PHASE 4 : Configuration Open WebUI
|
||||||
|
|
||||||
|
### Étape 4.1 : Configurer Audio
|
||||||
|
|
||||||
|
Accéder à : `http://192.168.1.27:3000`
|
||||||
|
|
||||||
|
**Admin Panel → Settings → Audio :**
|
||||||
|
|
||||||
|
**STT (Speech-to-Text) :**
|
||||||
|
- Engine: `OpenAI`
|
||||||
|
- OpenAI API Base URL: `http://192.168.1.11:8200/v1`
|
||||||
|
- Model: `deepdml/faster-whisper-large-v3-turbo-ct2`
|
||||||
|
|
||||||
|
**TTS (Text-to-Speech) :**
|
||||||
|
- Engine: `OpenAI`
|
||||||
|
- OpenAI API Base URL: `http://192.168.1.11:8100/v1`
|
||||||
|
- Model: `tts-1-hd`
|
||||||
|
- Voice: `nova` (ou `alloy` si pas de WAV)
|
||||||
|
|
||||||
|
### Étape 4.2 : Tester le pipeline complet
|
||||||
|
|
||||||
|
1. Ouvrir une conversation avec Effi
|
||||||
|
2. Cliquer sur le bouton micro 🎤
|
||||||
|
3. Parler : "Bonjour Effi, comment vas-tu ?"
|
||||||
|
4. Vérifier que :
|
||||||
|
- ✅ Le STT transcrit correctement
|
||||||
|
- ✅ Le LLM répond
|
||||||
|
- ✅ Le TTS lit la réponse à voix haute
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 PHASE 5 : Optimisations (Optionnelles)
|
||||||
|
|
||||||
|
### Option A : Créer des voix XTTS personnalisées
|
||||||
|
|
||||||
|
Si tu veux recréer des voix (nova, alloy, etc.) :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Il faut des échantillons audio de ~10 secondes par voix
|
||||||
|
# Format: WAV, 22050Hz, mono
|
||||||
|
|
||||||
|
cd ~/openedai-speech/tts-voices
|
||||||
|
|
||||||
|
# Copier un fichier audio source
|
||||||
|
cp /chemin/vers/echantillon.wav nova.wav
|
||||||
|
|
||||||
|
# Redémarrer le service
|
||||||
|
docker compose restart openedai-speech
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option B : Optimiser STT avec GPU (Avancé)
|
||||||
|
|
||||||
|
**⚠️ Complexe** - Nécessite compilation CTranslate2-rocm
|
||||||
|
|
||||||
|
Voir l'historique : `/docs/ARCHIVE/HISTORIQUE-COMPLET-EFFI.md`
|
||||||
|
Section : "Problème 2 : Build ROCm Whisper Échoué"
|
||||||
|
|
||||||
|
**Recommandation** : Attendre des packages précompilés ou rester en CPU pour l'instant.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧪 Commandes de diagnostic
|
||||||
|
|
||||||
|
### Vérifier les services
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Sur folzo-Corp
|
||||||
|
docker ps
|
||||||
|
|
||||||
|
# Test TTS
|
||||||
|
curl -s http://192.168.1.11:8100/v1/audio/speech \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"model":"tts-1","input":"Test","voice":"alloy"}' \
|
||||||
|
--output /tmp/test.mp3 && echo "TTS OK" || echo "TTS KO"
|
||||||
|
|
||||||
|
# Test STT
|
||||||
|
curl -s http://192.168.1.11:8200/v1/models | jq .
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
docker logs openedai-speech --tail 50 -f
|
||||||
|
docker logs speaches-stt --tail 50 -f
|
||||||
|
```
|
||||||
|
|
||||||
|
### Vérifier GPU ROCm
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rocm-smi
|
||||||
|
rocm-smi --showmeminfo vram
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Récapitulatif des fichiers créés
|
||||||
|
|
||||||
|
```
|
||||||
|
/home/folzo/
|
||||||
|
├── openedai-speech/
|
||||||
|
│ ├── docker-compose.yml
|
||||||
|
│ ├── tts-config/
|
||||||
|
│ │ └── voice_to_speaker.yaml
|
||||||
|
│ └── tts-voices/
|
||||||
|
│ ├── en_US-libritts_r-medium.onnx
|
||||||
|
│ ├── en_US-libritts_r-medium.onnx.json
|
||||||
|
│ └── (nova.wav, alloy.wav, etc. à ajouter)
|
||||||
|
│
|
||||||
|
└── speaches/
|
||||||
|
├── Dockerfile
|
||||||
|
├── docker-compose.yml
|
||||||
|
└── (code source cloné depuis GitHub)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚨 Dépannage courant
|
||||||
|
|
||||||
|
### Erreur : "Permission denied" /dev/kfd
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Vérifier les groupes
|
||||||
|
sudo usermod -a -G video,render $USER
|
||||||
|
# Déconnexion/reconnexion nécessaire
|
||||||
|
```
|
||||||
|
|
||||||
|
### Erreur : "Connection refused" depuis effi-server
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Sur folzo-Corp, vérifier firewall
|
||||||
|
sudo firewall-cmd --list-ports
|
||||||
|
# Doit contenir: 8100/tcp 8200/tcp
|
||||||
|
|
||||||
|
# Tester localement d'abord
|
||||||
|
curl http://localhost:8100/v1/models
|
||||||
|
curl http://localhost:8200/v1/models
|
||||||
|
```
|
||||||
|
|
||||||
|
### Erreur : Modèle non trouvé (speaches)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Vérifier que le modèle est bien enregistré
|
||||||
|
curl http://192.168.1.11:8200/v1/models
|
||||||
|
|
||||||
|
# S'il n'est pas listé, l'enregistrer manuellement:
|
||||||
|
curl -X POST http://192.168.1.11:8200/v1/models \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"model":"deepdml/faster-whisper-large-v3-turbo-ct2"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Références
|
||||||
|
|
||||||
|
- [openedai-speech GitHub](https://github.com/matatonic/openedai-speech)
|
||||||
|
- [speaches GitHub](https://github.com/speaches-ai/speaches)
|
||||||
|
- [Historique complet Effi](../ARCHIVE/HISTORIQUE-COMPLET-EFFI.md)
|
||||||
|
- [Configuration recap](../CONFIGURATION-RECAP-GITEA.md)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Document créé le 5 avril 2026 - Fedora installation*
|
||||||
Reference in New Issue
Block a user