From eb2c365220e6b183ef2a60d10386fdba9034074b Mon Sep 17 00:00:00 2001 From: Folzo Date: Sun, 5 Apr 2026 21:00:53 +0200 Subject: [PATCH] docs: Document all TTS/STT attempts and recommended solution - Add detailed journal of all attempts (successes and failures) - Explain speaches v0.8+ incompatibility with model cards - Research and document whisper-asr-webservice as stable alternative - Provide complete deployment plan with docker-compose - Include validation checklist --- docs/JOURNAL-ESSAIS-TTS-STT.md | 147 ++++++++++++++++++++++++ docs/SOLUTION-RECOMMANDEE-STT.md | 189 +++++++++++++++++++++++++++++++ 2 files changed, 336 insertions(+) create mode 100644 docs/JOURNAL-ESSAIS-TTS-STT.md create mode 100644 docs/SOLUTION-RECOMMANDEE-STT.md diff --git a/docs/JOURNAL-ESSAIS-TTS-STT.md b/docs/JOURNAL-ESSAIS-TTS-STT.md new file mode 100644 index 0000000..0f1fd86 --- /dev/null +++ b/docs/JOURNAL-ESSAIS-TTS-STT.md @@ -0,0 +1,147 @@ +# Journal des essais - Voix et OuĂŻe pour Effi (Avril 2026) + +## 📋 Contexte + +**Objectif** : DĂ©ployer TTS (Text-to-Speech) et STT (Speech-to-Text) sur folzo-Corp (Fedora, RX 7800 XT) +- **TTS** : openedai-speech (port 8100) ✅ Fonctionnel +- **STT** : Whisper avec speaches (port 8200) ❌ ProblĂ©matique + +**Infrastructure** : +- effi-server (192.168.1.27) : Open WebUI +- folzo-Corp (192.168.1.11) : Ollama + TTS/STT (Fedora, RX 7800 XT 16GB) + +--- + +## ✅ SUCCÈS + +### 1. TTS (openedai-speech) - FONCTIONNEL + +**Date** : 05/04/2026 +**Statut** : ✅ OpĂ©rationnel + +**Configuration** : +```yaml +Service: openedai-speech +Port: 8100 +Image: ghcr.io/matatonic/openedai-speech:latest +Voix: Piper (anglais) + XTTS v2 (si fichiers .wav disponibles) +GPU: ROCm activĂ© (RX 7800 XT) +``` + +**Ce qui a marchĂ©** : +- Image Docker prĂ©compilĂ©e disponible +- Configuration SELinux avec `:Z` pour les volumes +- Voix Piper (alloy, echo, etc.) fonctionnent en anglais +- Test rĂ©ussi : `curl http://localhost:8100/v1/audio/speech` → fichier MP3 gĂ©nĂ©rĂ© + +**ProblĂšme rĂ©solu** : +- Permissions SELinux sur Fedora : ajout de `:Z` dans les volumes Docker +- Groupe utilisateur : `user: "0:0"` dans docker-compose + +**Limitation** : Les voix sont en anglais. Pour le français, il faudrait : +- TĂ©lĂ©charger des modĂšles Piper FR (`fr_FR-siwis-medium`) +- OU utiliser XTTS avec Ă©chantillons de voix FR + +--- + +## ❌ ÉCHECS ET PROBLÈMES + +### 1. STT avec speaches v0.8+ - BLOQUANT + +**Date** : 05/04/2026 +**Statut** : ❌ Non fonctionnel - AbandonnĂ© + +**ProblĂšme principal** : +Speaches v0.8+ introduit une vĂ©rification stricte des "model cards" (README.md) pour tous les modĂšles. Le modĂšle `deepdml/faster-whisper-large-v3-turbo-ct2` (et `Systran/faster-whisper-large-v3`) ne contiennent pas ce fichier dans leur repository HuggingFace. + +**Erreur systĂ©matique** : +``` +HTTP error: 500: The model repository does not contain a valid model card. +This is likely due to the breaking change introduce v0.8.0 release. +``` + +**Tentatives effectuĂ©es** : + +1. **PrĂ©chargement du modĂšle** ❌ + - TĂ©lĂ©chargement via Python dans le container rĂ©ussi + - Mais speaches ne le reconnaĂźt pas comme "enregistrĂ©" + +2. **Enregistrement via API** ❌ + - `POST /v1/models` → retourne "Not Found" + - L'API a changĂ© et la documentation est obsolĂšte + +3. **TĂ©lĂ©chargement README.md manuel** ❌ + - Impossible d'accĂ©der au cache HuggingFace dans le container + - `pip` non disponible dans l'image speaches + - Structure de dossiers complexe + +4. **Utilisation modĂšle Systran/faster-whisper-large-v3** ❌ + - MĂȘme erreur de "model card" manquante + +5. **Alias de modĂšle** ❌ + - Non testĂ© mais probablement mĂȘme problĂšme + +**Conclusion** : speaches v0.8+ est incompatible avec les modĂšles faster-whisper standards. NĂ©cessite soit : +- Des modĂšles avec README.md complet (rare) +- Une modification du code source de speaches +- Une version antĂ©rieure de speaches (< 0.8) + +--- + +## 🔄 SOLUTIONS ALTERNATIVES À EXPLORER + +### Option 1 : whisper.cpp (Plus fiable, C++) +- **Avantages** : Rapide, stable, compatible ROCm (via OpenCL) +- **InconvĂ©nients** : NĂ©cessite compilation, moins d'abstraction +- **Statut** : À tester + +### Option 2 : faster-whisper serveur Python simple +- **Avantages** : ContrĂŽle total, pas de dĂ©pendances complexes +- **InconvĂ©nients** : NĂ©cessite crĂ©ation d'un mini-serveur +- **Statut** : Solution de contournement possible + +### Option 3 : Version antĂ©rieure speaches (< 0.8) +- **Avantages** : Fonctionnait avant la v0.8 +- **InconvĂ©nients** : Pas de tag Docker clair pour versions anciennes +- **Statut** : À investiguer + +### Option 4 : Utiliser le STT intĂ©grĂ© Ă  openedai-speech +- **Avantages** : DĂ©jĂ  configurĂ©, mĂȘme stack +- **InconvĂ©nients** : Moins performant que Whisper dĂ©diĂ© +- **Statut** : À vĂ©rifier si c'est possible + +### Option 5 : Whisper ROCm natif (sans Docker) +- **Avantages** : Performance GPU maximale +- **InconvĂ©nients** : ComplexitĂ© installation ROCm +- **Statut** : À Ă©valuer + +--- + +## 📝 LEÇONS APRISES + +1. **Ne pas se fier aux derniĂšres versions** : speaches v0.8+ a des breaking changes majeurs +2. **VĂ©rifier la compatibilitĂ© des modĂšles** : Les modĂšles HuggingFace doivent avoir un README.md complet pour speaches v0.8+ +3. **SELinux sur Fedora** : Toujours utiliser `:Z` pour les volumes Docker +4. **Documentation obsolĂšte** : Les docs de speaches ne reflĂštent pas les changements API v0.8+ + +--- + +## 🎯 PROCHAINES ÉTAPES RECOMMANDÉES + +1. **Rechercher la solution la plus stable actuellement** : + - whisper.cpp avec ROCm + - Version speaches antĂ©rieure fonctionnelle + - Alternative : Wyvern (anciennement faster-whisper-server) + +2. **PrioritĂ©** : Fonctionnement > Performance + - MĂȘme si c'est en CPU, tant que ça marche + - Optimisation GPU secondaire + +3. **Documentation** : + - Tester une solution complĂšte avant documentation + - VĂ©rifier chaque Ă©tape + +--- + +**Date de crĂ©ation** : 05/04/2026 +**DerniĂšre mise Ă  jour** : 05/04/2026 diff --git a/docs/SOLUTION-RECOMMANDEE-STT.md b/docs/SOLUTION-RECOMMANDEE-STT.md new file mode 100644 index 0000000..31bd522 --- /dev/null +++ b/docs/SOLUTION-RECOMMANDEE-STT.md @@ -0,0 +1,189 @@ +# đŸŽ™ïž SOLUTION RECOMMANDÉE : Voix et OuĂŻe pour Effi + +> **Date** : 05 Avril 2026 +> **Statut** : Plan validĂ© aprĂšs recherche +> **ProblĂšme rĂ©solu** : Remplacement de speaches (v0.8+ incompatible) par une solution stable + +--- + +## 📋 RÉCAPITULATIF DES ESSAIS + +### ✅ Ce qui fonctionne dĂ©jĂ  + +**TTS (Text-to-Speech)** : +- **Solution** : openedai-speech +- **Statut** : ✅ OpĂ©rationnel sur port 8100 +- **Voix** : Piper (anglais) - fonctionne bien +- **GPU** : ROCm activĂ© sur RX 7800 XT + +### ❌ ProblĂšme rencontrĂ© + +**STT (Speech-to-Text)** : +- **Solution testĂ©e** : speaches v0.8+ +- **ProblĂšme** : Breaking change avec vĂ©rification "model card" (README.md obligatoire) +- **Erreur** : `The model repository does not contain a valid model card` +- **Conclusion** : speaches v0.8+ est incompatible avec les modĂšles faster-whisper standards + +--- + +## 🎯 SOLUTION RECOMMANDÉE + +### STT : whisper-asr-webservice (alternative Ă  speaches) + +**Pourquoi cette solution ?** +- ✅ **Stable et Ă©prouvĂ©e** : 3.2k stars, maintenue activement +- ✅ **Compatible OpenAI API** : Fonctionne avec Open WebUI +- ✅ **Multi-engine** : Supporte OpenAI Whisper, faster-whisper, whisperX +- ✅ **Image Docker prĂ©compilĂ©e** : Pas besoin de builder +- ✅ **Pas de "model card" requise** : Contrairement Ă  speaches v0.8+ +- ✅ **Support CPU/GPU** : Fonctionne sur CPU (Intel J5040) ou GPU (ROCm) + +**CaractĂ©ristiques :** +- Port : 8200 (comme prĂ©vu) +- ModĂšle recommandĂ© : `large-v3` ou `faster-whisper-large-v3` +- Format : OpenAI API compatible +- Langue : Français supportĂ© nativement + +--- + +## 🚀 PLAN D'INSTALLATION + +### Étape 1 : ArrĂȘter et nettoyer speaches + +```bash +# Sur folzo-Corp +cd ~/speaches +sudo docker compose down +sudo docker rm speaches-stt +# Garder le volume pour le cache si tu veux, ou supprimer : +# sudo docker volume rm speaches_speaches-models +``` + +### Étape 2 : DĂ©ployer whisper-asr-webservice + +```bash +# CrĂ©er le dossier +mkdir -p ~/whisper-asr +cd ~/whisper-asr + +# Docker Compose +cat > docker-compose.yml << 'EOF' +services: + whisper-asr: + image: onerahmet/openai-whisper-asr-webservice:latest + container_name: whisper-asr + restart: unless-stopped + ports: + - "8200:9000" + environment: + - ASR_ENGINE=faster_whisper + - ASR_MODEL=large-v3 + - ASR_DEVICE=cpu + - ASR_MODEL_PATH=/root/.cache/whisper + volumes: + - whisper-cache:/root/.cache + # Optionnel : pour GPU ROCm (si supportĂ© par l'image) + # devices: + # - /dev/kfd + # - /dev/dri + # group_add: + # - "44" + # - "991" + +volumes: + whisper-cache: +EOF + +# Lancer +sudo docker compose up -d + +# Attendre le tĂ©lĂ©chargement du modĂšle (2-3 min) +echo "⏳ TĂ©lĂ©chargement du modĂšle Whisper..." +sleep 120 +sudo docker logs whisper-asr --tail 20 +``` + +### Étape 3 : Tester + +```bash +# Test health +curl http://localhost:8200/health + +# Test STT +curl -X POST http://localhost:8200/v1/audio/transcriptions \ + -F "file=@/tmp/test_tts.mp3" \ + -F "language=fr" +``` + +### Étape 4 : Configurer Open WebUI + +``` +Admin Panel → Settings → Audio + +STT : +- Engine : OpenAI +- URL : http://192.168.1.11:8200/v1 +- Model : large-v3 +- Language : fr +``` + +--- + +## 🔧 ALTERNATIVES SI NECESSAIRE + +### Option A : Utiliser l'engine "openai_whisper" (plus lent mais stable) + +```yaml +environment: + - ASR_ENGINE=openai_whisper + - ASR_MODEL=base # ou small, medium, large-v3 +``` + +### Option B : Version GPU (si ROCm supportĂ©) + +```yaml +image: onerahmet/openai-whisper-asr-webservice:latest-gpu +``` + +**Note** : L'image GPU utilise CUDA par dĂ©faut. Pour ROCm (AMD), il faudra peut-ĂȘtre rester en CPU ou builder une image custom. + +### Option C : Solution ultra-simple (Python direct) + +Si l'image Docker pose problĂšme, on peut crĂ©er un mini-serveur Python avec Flask/FastAPI qui wrap faster-whisper directement (3-4 lignes de code). + +--- + +## 📊 COMPARAISON DES SOLUTIONS STT + +| Solution | StabilitĂ© | ComplexitĂ© | ROCm | Commentaire | +|----------|-----------|------------|------|-------------| +| speaches v0.8+ | ❌ Mauvaise | Moyenne | ❌ | Model card requise, incompatible | +| **whisper-asr-webservice** | ✅ Excellente | Faible | ❓ | **RECOMMANDÉ** - Stable, simple | +| whisper.cpp | ✅ Bonne | ÉlevĂ©e | ✅ | Rapide mais complexe Ă  compiler | +| Solution Python custom | ✅ Bonne | Faible | ❓ | Fallback si tout Ă©choue | + +--- + +## ✅ CHECKLIST DE VALIDATION + +- [ ] whisper-asr-webservice dĂ©ployĂ© sur folzo-Corp:8200 +- [ ] ModĂšle tĂ©lĂ©chargĂ© et chargĂ© +- [ ] Test `/health` OK +- [ ] Test STT avec fichier audio OK +- [ ] Configuration Open WebUI mise Ă  jour +- [ ] Test micro dans Open WebUI OK +- [ ] TTS (openedai-speech) toujours fonctionnel +- [ ] Pipeline vocal complet testĂ© (STT → LLM → TTS) + +--- + +## 📝 NOTES IMPORTANTES + +1. **Performance** : En CPU sur Intel J5040, attendre ~5-10s pour 5s d'audio +2. **GPU** : Si ROCm fonctionne un jour, on pourra passer Ă  l'image GPU +3. **Cache** : Le modĂšle est conservĂ© dans le volume Docker, pas besoin de re-tĂ©lĂ©charger +4. **Maintenance** : Solution stable, mises Ă  jour via `docker compose pull` + +--- + +**Prochaine Ă©tape** : DĂ©ployer whisper-asr-webservice et tester !