Files
Effi/docs/02-configuration/audio-stt-tts.md
T
Folzo d1e12cff60 Initial commit: Documentation Effi v1.0
- Structure complète du projet
- Docker compose de production
- Documentation organisée par thèmes
- Guides d'installation et configuration
- Section dépannage détaillée
- Journal historique
2026-04-04 08:45:59 +02:00

231 lines
5.3 KiB
Markdown

# 🎤 Configuration Audio (STT + TTS)
## Vue d'ensemble
Effi dispose d'un pipeline vocal complet fonctionnant sur **folzo-Corp** (PC Gaming avec RX 7800 XT) :
- **STT** (Speech-to-Text) : Whisper via speaches avec ROCm
- **TTS** (Text-to-Speech) : Piper/XTTS via openedai-speech
---
## STT - Speaches (Whisper)
### Configuration Docker Compose
Fichier : `~/speaches/docker-compose.yml` (sur folzo-Corp)
```yaml
services:
speaches:
image: speaches:rocm-ct2
container_name: speaches-stt
restart: unless-stopped
ports:
- "8200:8000"
devices:
- /dev/kfd
- /dev/dri
group_add:
- "44"
- "991"
security_opt:
- seccomp=unconfined
environment:
- HSA_OVERRIDE_GFX_VERSION=11.0.0
- WHISPER__MODEL=deepdml/faster-whisper-large-v3-turbo-ct2
- WHISPER__LANGUAGE=fr
- WHISPER__COMPUTE_TYPE=float32
- WHISPER__DEVICE=auto
volumes:
- speaches-models:/root/.cache/huggingface
speaches-init:
image: curlimages/curl:latest
container_name: speaches-init
restart: "no"
depends_on:
- speaches
entrypoint: >
sh -c "sleep 5 &&
curl -sf -X POST http://speaches:8000/v1/models/deepdml%2Ffaster-whisper-large-v3-turbo-ct2 &&
echo 'Modèle enregistré'"
volumes:
speaches-models:
```
### Modèle utilisé
**`deepdml/faster-whisper-large-v3-turbo-ct2`**
- Version optimisée CTranslate2
- Support ROCm (GPU AMD)
- Turbo = version rapide du large-v3
- Langue : Français forcé (`fr`)
### Points importants
1. **Build personnalisé** : L'image `speaches:rocm-ct2` doit être construite localement
2. **Architecture GPU** : gfx1100 (RX 7800 XT)
3. **Compute type** : `float32` en CPU, `float16` en GPU
4. **Initialisation** : Le service `speaches-init` enregistre le modèle au démarrage
---
## TTS - OpenedAI-Speech (Piper)
### Configuration Docker Compose
Fichier : `~/openedai-speech/docker-compose.yml` (sur folzo-Corp)
```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"
- "991"
environment:
- HSA_OVERRIDE_GFX_VERSION=11.0.0
- HIP_VISIBLE_DEVICES=0
```
### Voix disponibles
#### Piper (CPU - Recommandé pour usage standard)
**Voix française** : `fr_FR-upmc-medium`
```bash
# Téléchargement
cd ~/openedai-speech/tts-voices
wget https://huggingface.co/rhasspy/piper-voices/resolve/main/fr/fr_FR/upmc/medium/fr_FR-upmc-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/main/fr/fr_FR/upmc/medium/fr_FR-upmc-medium.onnx.json
```
Configuration (`tts-config/config.yaml`) :
```yaml
tts-1:
alloy:
model: voices/fr_FR-upmc-medium.onnx
speaker: 0 # 0 = voix féminine
```
### Points importants
1. **group_add numériques** : Utiliser `"44"` et `"991"` (pas les noms)
2. **ROCm activé** : `HSA_OVERRIDE_GFX_VERSION=11.0.0`
3. **Fallback CPU** : Piper fonctionne aussi en CPU si GPU indisponible
---
## Configuration Open WebUI
**Admin Panel → Settings → Audio**
### Paramètres STT
| Paramètre | Valeur |
|-----------|--------|
| Engine | `OpenAI` |
| URL | `http://192.168.1.11:8200/v1` |
| Model | `deepdml/faster-whisper-large-v3-turbo-ct2` |
| API Key | `anything` (valeur quelconque) |
### Paramètres TTS
| Paramètre | Valeur |
|-----------|--------|
| Engine | `OpenAI` |
| URL | `http://192.168.1.11:8100/v1` |
| Model | `tts-1` (Piper) ou `tts-1-hd` (XTTS) |
| Voice | `alloy` |
---
## Build CTranslate2 ROCm (speaches)
### Pourquoi un build personnalisé ?
L'image officielle speaches ne publie pas d'image ROCm. Il faut builder CTranslate2 depuis les sources avec :
- Support MIOpen (équivalent ROCm de cuDNN)
- Architecture gfx1100 (RX 7800 XT)
### Procédure de build
```bash
# 1. Cloner le repo
cd ~
git clone https://github.com/speaches-ai/speaches.git
cd speaches
# 2. Modifier le Dockerfile pour gfx1100
cd src
sed -i 's/gfx1101/gfx1100/g' Dockerfile.rocm-ct2
# 3. Build (~50 min la première fois)
docker build -f Dockerfile.rocm-ct2 -t speaches:rocm-ct2 .
```
### Architecture GPU
Vérifier votre architecture :
```bash
docker run --device /dev/kfd --device /dev/dri \
-e HSA_OVERRIDE_GFX_VERSION=11.0.0 speaches:rocm-ct2 \
/opt/rocm-6.3.4/bin/rocminfo | grep -E "gfx|Name"
```
Cartes courantes :
- RX 7800 XT : `gfx1100`
- RX 7900 XTX : `gfx1100`
- RX 7700 XT : `gfx1101`
---
## Dépannage audio
### Erreur : "float16 not supported on CPU backend"
**Solution** : Changer `WHISPER__COMPUTE_TYPE` :
```yaml
environment:
- WHISPER__COMPUTE_TYPE=int8 # ou float32
```
### Erreur : "Unable to find group render"
**Solution** : Utiliser les GID numériques :
```yaml
group_add:
- "44" # video
- "991" # render
```
### Erreur : "hipErrorInvalidDeviceFunction"
**Cause** : Mauvaise architecture GPU dans le build
**Solution** : Rebuilder avec la bonne valeur gfx (voir section Build)
---
## Performance attendue
| Composant | Mode | Latence | Notes |
|-----------|------|---------|-------|
| STT | CPU (int8) | ~10s pour 5s audio | Utilisation 100% CPU |
| STT | GPU (ROCm) | ~1s pour 5s audio | Objectif après rebuild |
| TTS Piper | CPU | ~300ms | Léger, utilisable |
| TTS XTTS | GPU | ~500ms-2s | Qualité supérieure |