Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
bb751d6
1
Parent(s):
84def65
Translate README to English for international accessibility
Browse files
README.md
CHANGED
|
@@ -14,45 +14,45 @@ disable_embedding: false
|
|
| 14 |
|
| 15 |
# 🎙️ Speech-to-Speech Translator
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
## ✨
|
| 20 |
|
| 21 |
-
- 🎵 **
|
| 22 |
-
- 🎙️ **Transcription
|
| 23 |
-
- 🌍 **
|
| 24 |
-
- 🔊 **
|
| 25 |
-
- 🚀 **Zero GPU Compatible** :
|
| 26 |
-
- 🎨 **Interface
|
| 27 |
-
- ⚡ **
|
| 28 |
-
- 🔧 **Configuration
|
| 29 |
|
| 30 |
-
## 🚀
|
| 31 |
|
| 32 |
-
### Interface
|
| 33 |
|
| 34 |
-
1. **
|
| 35 |
-
2. **
|
| 36 |
-
3. **
|
| 37 |
-
4. **
|
| 38 |
-
- **
|
| 39 |
-
- **
|
| 40 |
-
- **
|
| 41 |
|
| 42 |
-
###
|
| 43 |
|
| 44 |
```
|
| 45 |
Audio Input → STT (Whisper) → Translation (Helsinki-NLP) → TTS (gTTS) → Audio Output
|
| 46 |
↓ ↓ ↓ ↓
|
| 47 |
-
|
| 48 |
```
|
| 49 |
|
| 50 |
-
###
|
| 51 |
|
| 52 |
-
- **Limitation
|
| 53 |
-
- **
|
| 54 |
-
- **Interface
|
| 55 |
-
- **
|
| 56 |
|
| 57 |
## 🛠️ Installation
|
| 58 |
|
|
@@ -107,32 +107,32 @@ TradLiveHug/
|
|
| 107 |
|
| 108 |
The `requirements.txt` file contains all necessary dependencies for automatic deployment.
|
| 109 |
|
| 110 |
-
## 🎯
|
| 111 |
|
| 112 |
### STT (Speech-to-Text)
|
| 113 |
-
- **
|
| 114 |
-
- **
|
| 115 |
-
- **
|
| 116 |
-
- **Limitation** :
|
| 117 |
-
- **Performance** :
|
| 118 |
-
|
| 119 |
-
###
|
| 120 |
-
- **
|
| 121 |
-
- **Support** :
|
| 122 |
-
- **
|
| 123 |
-
- **Performance** :
|
| 124 |
|
| 125 |
### TTS (Text-to-Speech)
|
| 126 |
-
- **
|
| 127 |
-
- **
|
| 128 |
-
- **
|
| 129 |
-
- **Format** : MP3
|
| 130 |
|
| 131 |
### Architecture
|
| 132 |
-
- **Zero GPU** :
|
| 133 |
-
- **
|
| 134 |
-
- **Interface** : Gradio
|
| 135 |
-
- **
|
| 136 |
|
| 137 |
## 🔍 Usage Examples
|
| 138 |
|
|
@@ -155,37 +155,37 @@ Translation: "Je suis heureux de vous rencontrer"
|
|
| 155 |
Audio: [French audio file]
|
| 156 |
```
|
| 157 |
|
| 158 |
-
## 🐛
|
| 159 |
|
| 160 |
-
###
|
| 161 |
|
| 162 |
-
- **"Models not loaded"** :
|
| 163 |
-
- **"No transcription"** :
|
| 164 |
-
- **"TTS Error"** :
|
| 165 |
-
- **"Audio too long"** :
|
| 166 |
-
- **"Processing error"** :
|
| 167 |
|
| 168 |
### Performance
|
| 169 |
|
| 170 |
-
- **
|
| 171 |
-
- **
|
| 172 |
-
- **
|
| 173 |
-
- **GPU** :
|
| 174 |
|
| 175 |
-
### Configuration
|
| 176 |
|
| 177 |
-
- **Local** :
|
| 178 |
-
- **Hugging Face Spaces** :
|
| 179 |
-
- **
|
| 180 |
|
| 181 |
## 📝 Notes
|
| 182 |
|
| 183 |
-
- **Zero GPU** : Compatible
|
| 184 |
-
- **
|
| 185 |
-
- **Interface** :
|
| 186 |
-
- **Formats** : Support WAV, MP3
|
| 187 |
-
- **Limitation** : Audio
|
| 188 |
-
- **
|
| 189 |
|
| 190 |
## 📄 License
|
| 191 |
|
|
|
|
| 14 |
|
| 15 |
# 🎙️ Speech-to-Speech Translator
|
| 16 |
|
| 17 |
+
Modern Gradio application for real-time audio translation, compatible with Hugging Face Spaces (Zero GPU).
|
| 18 |
|
| 19 |
+
## ✨ Features
|
| 20 |
|
| 21 |
+
- 🎵 **Audio Recording** : Intuitive interface to record up to 30 seconds
|
| 22 |
+
- 🎙️ **Automatic Transcription** : STT (Speech-to-Text) with optimized Whisper model
|
| 23 |
+
- 🌍 **Real-time Translation** : French ↔ English with Helsinki-NLP
|
| 24 |
+
- 🔊 **Speech Synthesis** : TTS (Text-to-Speech) with gTTS and automatic language detection
|
| 25 |
+
- 🚀 **Zero GPU Compatible** : Optimized for Hugging Face Spaces with on-demand GPU
|
| 26 |
+
- 🎨 **Modern Interface** : Responsive design with custom CSS and animations
|
| 27 |
+
- ⚡ **Smart Management** : Automatic environment detection (local/cloud)
|
| 28 |
+
- 🔧 **Auto Configuration** : Ports and parameters adapted according to deployment
|
| 29 |
|
| 30 |
+
## 🚀 Usage
|
| 31 |
|
| 32 |
+
### Web Interface (Gradio)
|
| 33 |
|
| 34 |
+
1. **Record Audio** : Click "Record" and speak into your microphone (max 30 seconds)
|
| 35 |
+
2. **Configure Languages** : Select source (fr/en) and target (en/fr) languages
|
| 36 |
+
3. **Process Audio** : Click "🚀 Process Audio"
|
| 37 |
+
4. **View Results** :
|
| 38 |
+
- **"🔊 Generated Audio" Tab** : Generated translated audio
|
| 39 |
+
- **"🎙️ Transcription" Tab** : Transcribed text
|
| 40 |
+
- **"🌍 Translation" Tab** : Translated text
|
| 41 |
|
| 42 |
+
### Processing Flow
|
| 43 |
|
| 44 |
```
|
| 45 |
Audio Input → STT (Whisper) → Translation (Helsinki-NLP) → TTS (gTTS) → Audio Output
|
| 46 |
↓ ↓ ↓ ↓
|
| 47 |
+
Recorded Transcribed Translated Generated Audio
|
| 48 |
```
|
| 49 |
|
| 50 |
+
### Advanced Features
|
| 51 |
|
| 52 |
+
- **Automatic Limitation** : Recordings > 30s are automatically truncated
|
| 53 |
+
- **Language Detection** : TTS automatically detects the language of translated text
|
| 54 |
+
- **Responsive Interface** : Adaptive design with smooth animations and transitions
|
| 55 |
+
- **Error Management** : Real-time status messages with color codes
|
| 56 |
|
| 57 |
## 🛠️ Installation
|
| 58 |
|
|
|
|
| 107 |
|
| 108 |
The `requirements.txt` file contains all necessary dependencies for automatic deployment.
|
| 109 |
|
| 110 |
+
## 🎯 Technical Features
|
| 111 |
|
| 112 |
### STT (Speech-to-Text)
|
| 113 |
+
- **Model** : OpenAI Whisper Small (openai/whisper-small)
|
| 114 |
+
- **Optimization** : Adaptive CPU/GPU according to environment
|
| 115 |
+
- **Languages** : French and English support with automatic detection
|
| 116 |
+
- **Limitation** : Automatic truncation to 30 seconds
|
| 117 |
+
- **Performance** : Optimized for Hugging Face Spaces Zero GPU
|
| 118 |
+
|
| 119 |
+
### Translation
|
| 120 |
+
- **Models** : Helsinki-NLP Opus-MT (fr-en and en-fr)
|
| 121 |
+
- **Support** : Bidirectional French ↔ English
|
| 122 |
+
- **Cleaning** : Automatic removal of translation prefixes
|
| 123 |
+
- **Performance** : Smart model loading
|
| 124 |
|
| 125 |
### TTS (Text-to-Speech)
|
| 126 |
+
- **Engine** : gTTS (Google Text-to-Speech) for all environments
|
| 127 |
+
- **Detection** : Automatic language based on text content
|
| 128 |
+
- **Quality** : Natural voices for French and English
|
| 129 |
+
- **Format** : MP3 optimized for web streaming
|
| 130 |
|
| 131 |
### Architecture
|
| 132 |
+
- **Zero GPU** : Full support with `@spaces.GPU` decorator
|
| 133 |
+
- **Environment** : Automatic detection local vs Hugging Face Spaces
|
| 134 |
+
- **Interface** : Gradio with custom CSS and modern design
|
| 135 |
+
- **Error Handling** : Robust system with status messages
|
| 136 |
|
| 137 |
## 🔍 Usage Examples
|
| 138 |
|
|
|
|
| 155 |
Audio: [French audio file]
|
| 156 |
```
|
| 157 |
|
| 158 |
+
## 🐛 Troubleshooting
|
| 159 |
|
| 160 |
+
### Common Issues
|
| 161 |
|
| 162 |
+
- **"Models not loaded"** : Wait for initial loading (1-2 minutes)
|
| 163 |
+
- **"No transcription"** : Check audio quality and volume
|
| 164 |
+
- **"TTS Error"** : Check internet connection for gTTS
|
| 165 |
+
- **"Audio too long"** : Audio is automatically truncated to 30 seconds
|
| 166 |
+
- **"Processing error"** : Check logs for more details
|
| 167 |
|
| 168 |
### Performance
|
| 169 |
|
| 170 |
+
- **First launch** : 1-2 minutes (model download)
|
| 171 |
+
- **Audio processing** : 5-15 seconds depending on duration
|
| 172 |
+
- **Memory** : ~2-3 GB RAM required
|
| 173 |
+
- **GPU** : Automatic usage if available (Zero GPU on HF Spaces)
|
| 174 |
|
| 175 |
+
### Environment Configuration
|
| 176 |
|
| 177 |
+
- **Local** : Automatic GPU/CPU detection, automatic free port
|
| 178 |
+
- **Hugging Face Spaces** : Automatic Zero GPU configuration
|
| 179 |
+
- **Deployment** : Ports and parameters automatically adapted
|
| 180 |
|
| 181 |
## 📝 Notes
|
| 182 |
|
| 183 |
+
- **Zero GPU** : Compatible with Hugging Face Spaces Zero GPU
|
| 184 |
+
- **Optimization** : Adaptive CPU/GPU according to environment
|
| 185 |
+
- **Interface** : Modern design with custom CSS and animations
|
| 186 |
+
- **Formats** : Support for WAV, MP3 and other common audio formats
|
| 187 |
+
- **Limitation** : Audio automatically truncated to 30 seconds
|
| 188 |
+
- **Deployment** : Automatic configuration for local and cloud
|
| 189 |
|
| 190 |
## 📄 License
|
| 191 |
|