""" πŸ“Š RΓ‰SUMΓ‰ - Meta MMS Speech AI (Gradio) Application Gradio pour: - ASR: Audio β†’ Texte (100+ langues) - TTS: Texte β†’ Audio (8 langues) DΓ©ployΓ©e sur Hugging Face Spaces """ print(""" ╔════════════════════════════════════════════════════════════════╗ β•‘ πŸŽ™οΈ Meta MMS Speech AI - Gradio πŸ“’ β•‘ β•‘ Reconnaissance vocale + SynthΓ¨se vocale multilingue β•‘ β•‘ Interface Web β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“‹ FILES DU PROJET ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“‚ CORE: πŸ“„ app.py ⭐ Application Gradio πŸ“„ requirements.txt ⭐ DΓ©pendances πŸ“‚ DOCUMENTATION: πŸ“„ README.md β†’ Guide d'utilisation πŸ“„ GRADIO_DEPLOY.md β†’ Guide de dΓ©ploiement sur HF πŸ“„ ARCHITECTURE.md β†’ Architecture technique πŸ“„ DEPLOYMENT.md β†’ (Ancien, pour Flask) πŸ“‚ UTILITAIRES: πŸ“„ run.sh β†’ Lancer l'app facilement πŸ“„ client.py β†’ Client Python (optionnel) πŸ“„ examples.py β†’ Exemples d'utilisation πŸ“„ test_api.py β†’ Tests unitaires πŸ“‚ CONFIG: πŸ“„ .gitignore β†’ Git configuration πŸ“„ requirements-dev.txt β†’ DΓ©pendances dev ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 FEATURES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ”Š ASR (Automatic Speech Recognition): β€’ ModΓ¨le: facebook/mms-1b-all (964M params) β€’ Langues: 100+ (ISO 639-3) β€’ Input: Audio (microphone ou upload) β€’ Output: Texte transcrit β€’ Limite: 30 secondes πŸ“’ TTS (Text-to-Speech): β€’ ModΓ¨les: facebook/mms-tts-* (VITS) β€’ Langues: 8 (beh, bba, ddn, ewe, gej, tbz, yor, eng) β€’ Input: Texte (max 1000 chars) β€’ Output: Audio WAV (22050 Hz) 🌐 Interface: β€’ Gradio (web UI moderne) β€’ 3 onglets: ASR, TTS, About β€’ Responsive design β€’ Partage automatique avec .share ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸš€ DΓ‰MARRAGE RAPIDE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1️⃣ Installation: cd /home/ronaldo/Bureau/test pip install -r requirements.txt 2️⃣ Lancer l'app: python app.py # ou: bash run.sh 3️⃣ Ouvrir dans le navigateur: http://localhost:7860 4️⃣ Utiliser: - ASR: Enregistre/upload audio β†’ Transcris - TTS: Γ‰cris texte β†’ GΓ©nΓ¨re audio ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🌐 DΓ‰PLOIEMENT SUR HUGGING FACE SPACES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1️⃣ CrΓ©er un Space: https://huggingface.co/new-space - SDK: Gradio - Template: Blank 2️⃣ Cloner: git clone https://huggingface.co/spaces// cd 3️⃣ Copier: cp app.py requirements.txt README.md . 4️⃣ Push: git add . git commit -m "Add MMS Speech" git push 5️⃣ Attendre: ~15-20 minutes pour le dΓ©ploiement complet πŸ“Œ Voir GRADIO_DEPLOY.md pour les instructions dΓ©taillΓ©es! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ’‘ TIPS IMPORTANTS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βœ… Cache des modΓ¨les: Les modΓ¨les sont chargΓ©s UNE FOIS et mis en cache. PremiΓ¨re requΓͺte: 2-5 min RequΓͺtes suivantes: 1-10 sec βœ… GPU/CPU: DΓ©tection automatique du GPU. Fallback CPU si GPU non disponible. βœ… Langues TTS disponibles: - beh (Biali) πŸ‡§πŸ‡― - bba (Baatombu) πŸ‡§πŸ‡― - ddn (Dendi) πŸ‡§πŸ‡― - ewe (Γ‰wΓ©) πŸ‡¬πŸ‡­ - gej (Mina) πŸ‡§πŸ‡― - tbz (Ditammari) πŸ‡§πŸ‡― - yor (Yoruba) πŸ‡³πŸ‡¬ - eng (English) πŸ‡¬πŸ‡§ βœ… DΓ©pannage: - Voir README.md section "Troubleshooting" - Voir GRADIO_DEPLOY.md section "Troubleshooting" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“š STRUCTURE DE L'APP GRADIO ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ app.py contient: 1️⃣ Imports & Configuration - ModΓ¨les: ASR (mms-1b-all) + TTS (mms-tts-*) - Config: SAMPLE_RATE, MAX_AUDIO_LENGTH, etc. 2️⃣ Functions principales - load_asr_model() β†’ Charge le modΓ¨le ASR - load_tts_model() β†’ Charge les modΓ¨les TTS - transcribe_audio() β†’ Transcription audio - synthesize_speech() β†’ GΓ©nΓ©ration audio 3️⃣ Interface Gradio (3 onglets) - ASR Tab: Enregistre/upload + transcris - TTS Tab: Γ‰crit texte + gΓ©nΓ¨re audio - About Tab: Infos + documentation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ”— RESSOURCES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“š Documentation: β€’ Meta MMS Paper: https://arxiv.org/abs/2305.13516 β€’ facebook/mms-1b-all: https://huggingface.co/facebook/mms-1b-all β€’ facebook/mms-tts: https://huggingface.co/facebook/mms-tts β€’ Gradio Docs: https://www.gradio.app/ β€’ HF Spaces: https://huggingface.co/spaces πŸ› οΈ Outils: β€’ Transformers: https://huggingface.co/docs/transformers β€’ PyTorch: https://pytorch.org/ β€’ Librosa: https://librosa.org/ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βš–οΈ LICENCE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ CC-BY-NC-4.0 (comme les modΓ¨les Meta MMS) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Γ€ bientΓ΄t! πŸŽ™οΈ Pour commencer: python app.py Pour dΓ©ployer: Voir GRADIO_DEPLOY.md Bon codage! πŸš€ """)