# Amharic TTS Prototype (WAXAL-based)
## Approach summary (before implementation)
1. **Inspect first, assume nothing**: detect real schema/config names and split names from `google/WaxalNLP` before preprocessing.
2. **Prototype-first pipeline**: keep an end-to-end path that runs on CPU with a toy backend, while allowing a stronger optional Coqui inference path.
3. **Defensive coding**: dynamically detect columns/splits and continue inspection even when some dataset configs fail.
4. **Clear fallback behavior**: API/UI/CLI should remain usable when checkpoints or heavy dependencies are missing.
## Key assumptions
- WAXAL config names and schema may evolve; scripts are resilient but still depend on remote dataset availability.
- High-quality Amharic TTS requires stronger modeling than the toy backend (e.g., Coqui or similar), more training time, and language front-end tuning.
## Project structure
```
.
├── README.md
├── requirements.txt
├── .gitignore
├── configs/
│ ├── train.yaml
│ └── infer.yaml
├── scripts/
│ ├── inspect_waxal.py
│ ├── preprocess.py
│ └── train.py
├── app/
│ ├── api.py
│ ├── audio_utils.py
│ ├── dataset_utils.py
│ ├── gradio_app.py
│ ├── infer.py
│ ├── model_loader.py
│ └── text_normalization.py
└── tests/
```
## Setup
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
Optional stronger backend:
```bash
pip install TTS
```
## 1) Inspect WAXAL dataset schema
```bash
python scripts/inspect_waxal.py
```
This script:
- enumerates dataset configs,
- discovers available split names per config,
- auto-selects a text split (`train` preferred),
- auto-detects text/audio columns,
- prints 3 sample records,
- writes `artifacts/dataset_summary.json`, including per-config errors.
## 2) Preprocess Amharic subset
After inspection, choose the Amharic config:
```bash
python scripts/preprocess.py \
--config \
--out-dir data/processed/amharic_tts \
--sample-rate 22050 \
--min-sec 0.5 \
--m …