Here’s a well-structured `README.md` for your Kinyarwanda Voice Assistant project, using appropriate markdown tags for clarity and documentation best practices:
---
```markdown
# 🗣️ Kinyarwanda Voice Assistant
A bilingual voice assistant built with Whisper for speech-to-text and TTS for text-to-speech, supporting Kinyarwanda Q&A and voice synthesis. It features an interactive Gradio interface with two main modes: voice assistant and custom text-to-speech (TTS).
---
## 🔧 Features
- 🎙️ **Speech Recognition** using OpenAI Whisper.
- 💬 **Kinyarwanda Q&A** using predefined text responses.
- 🔊 **Text-to-Speech** using Hugging Face's `TTS` API.
- 🖥️ **Interactive Interface** using Gradio Tabs.
- 🔁 **Speaker Voice Transfer** (using reference audio).
- 🌐 **Web UI Launch with Sharing Option**.
---
---
## 🛠️ Installation & Setup
### ⚙️ Python Environment
Install dependencies in your Python environment or Jupyter notebook (e.g., Colab):
```bash
pip install -q openai-whisper
pip install numpy==1.24.3 --force-reinstall
pip install gradio
pip install transformers
pip install torchaudio
pip install TTS
pip install nemo-toolkit
```
> You can also install all required packages with:
```bash
pip install --no-cache-dir -r /content/drive/MyDrive/kinya-assistant/stt/requirements.txt
```
### 🧰 System Dependencies (for SoX audio tools)
```bash
apt-get update && apt-get install -y sox libsox-fmt-all
```
---
## 🚀 How to Use
### 🎤 Voice Assistant
- Upload your audio file or record directly.
- The system:
- Transcribes audio using Whisper.
- Matches text to pre-defined Kinyarwanda questions.
- Responds using TTS and plays the audio back.
### 📢 Text-to-Speech
- Enter your desired text.
- Provide a WAV file as a reference speaker.
- Choose a language (`` supported).
- Synthesized speech will be generated and played back.
---
## 🧠 Code Overview
### Load Whisper & TTS Models
```python
whisper_model = whisper.load_model("small")
hf_model = TTS(model_name="tts_models/en/ljs …