Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
0
80
# ─────────────────────────────────────────────────────────────────────────────
# Amharic TTS β€” Python dependencies
#
# CPU-only PyTorch install (much smaller download than the CUDA wheel).
# If you have a GPU and want to use it, remove the --extra-index-url line
# and change `torch` to `torch torchvision` with your CUDA version.
# ─────────────────────────────────────────────────────────────────────────────
# ── PyTorch (CPU wheel) ───────────────────────────────────────────────────────
--extra-index-url https://download.pytorch.org/whl/cpu
torch>=2.1.0
# ── Hugging Face stack ────────────────────────────────────────────────────────
transformers>=4.40.0 # VitsModel + VitsTokenizer with uroman support
huggingface_hub>=0.23.0 # model downloading / caching
# ── Romanisation β€” REQUIRED for MMS-TTS ──────────────────────────────────────
# The VitsTokenizer calls uroman to convert Amharic (Ethiopic) β†’ Latin script.
uroman>=1.3.1
# ── Audio ─────────────────────────────────────────────────────────────────────
scipy>=1.11.0 # scipy.io.wavfile for writing WAV files
numpy>=1.24.0
# ── Web UI ────────────────────────────────────────────────────────────────────
gradio>=4.28.0
# ── Misc ─────────────────────────────────────────────────────────────────────
accelerate>=0.27.0 # optional but speeds up model loading

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

πŸŽ™οΈ Amharic Text-to-Speech β€” facebook/mms-tts-amh

A fully free, offline Amharic TTS app using Meta's MMS model, running locally via Gradio.
No API keys. No internet connection required after the model is downloaded.


πŸ“ File Structure

amharic_tts/
β”œβ”€β”€ app.py            ← main application (single file)
β”œβ”€β”€ requirements.txt  ← Python dependencies
└── README.md         ← this file

πŸ–₯️ Local Setup (Step-by-Step)

Prerequisites

  • Python 3.9 – 3.12 (3.10 recommended)
  • ~2 GB free disk space (model cache + packages)
  • No GPU required

Step 1 β€” Clone / download the files

Place app.py and requirements.txt in a folder, e.g. amharic_tts/.

mkdir amharic_tts && cd amharic_tts
# copy app.py and requirements.txt here

Step 2 β€” Create a virtual environment

# Create
python -m venv venv

# Activate β€” macOS / Linux
source venv/bin/activate

# Activate β€” Windows (PowerShell)
venv\Scripts\Activate.ps1

Step 3 β€” Install dependencies

pip install --upgrade pip
pip install -r requirements.txt

First install takes 3–8 min because it downloads the CPU PyTorch wheel (~220 MB).


Step 4 β€” Run the app

python app.py

You should see:

Pre-loading model at startup …
⏳  Loading facebook/mms-tts-amh β€” this may take a minute on first run …
βœ…  Model ready  (sampling_rate=16000 Hz)
Running on local URL:  http://0.0.0.0:7860

First run downloads ~330 MB from Hugging Face Hub and caches it in
~/.cache/huggingface/hub/.
Subsequent runs start in seconds.

Open your browser at http://localhost:7860 and start typing!


Troubleshooting

Symptom Fix
ModuleNotFoundError: uroman pip install uroman
No module named 'transformers' pip install transformers>=4.40.0
Slow first generation Normal β€” model loads on first request if pre-load failed
Port 7860 already in use Change server_port=7861 in app.py
OMP: Error #15 on macOS export KMP_DUPLICATE_LIB_OK=TRUE before running

πŸš€ Free Deployment on Hugging Face Spaces

Hugging Face Spaces gives you a completely free public URL with 2 vCPUs and 16 GB RAM β€” plenty for CPU inference.

Step 1 β€” Create a Space

  1. Go to huggingface.co/spaces and sign in.
  2. Click New Space.
  3. Set:
    • Space name: amharic-tts (or anything you like)
    • SDK: Gradio
    • Hardware: CPU Basic (free tier)
    • Visibility: Public or Private

Step 2 β€” Upload your files

Upload both files via the web UI "Files" tab, or use the Git CLI:

# Install HF CLI if needed
pip install huggingface_hub

# Login
huggingface-cli login

# Clone your empty space
git clone https://huggingface.co/spaces/YOUR_USERNAME/amharic-tts
cd amharic-tts

# Copy your files in
cp /path/to/app.py .
cp /path/to/requirements.txt .

# Push
git add .
git commit -m "Initial Amharic TTS app"
git push

Step 3 β€” Wait for the build

Spaces automatically installs requirements.txt and runs app.py.
Watch the Logs tab β€” build takes 3 min.
First synthesis downloads the model (
330 MB) into the Space's cache.

Step 4 β€” Share!

Your app is now live at:
https://huggingface.co/spaces/YOUR_USERNAME/amharic-tts


βš™οΈ How uroman Works

The MMS-TTS model was trained on romanised (Latin-script) phonetic text, not raw Ethiopic script. The uroman library converts:

αˆ°αˆ‹αˆ! β†’ sΓ€lam!

transformers >= 4.36 ships built-in support: the VitsTokenizer detects that facebook/mms-tts-amh needs uroman and calls it automatically during tokenizer(text, return_tensors="pt").

If uroman is not installed you'll get an ImportError with a clear message.


πŸ“œ Licence

Downloads last month
19