Khaya Live Translator

A bidirectional Ghana-focused speech-to-speech translation Space designed for Hugging Face ZeroGPU.

Important: ZeroGPU setup

This project is designed for a Gradio ZeroGPU Space, not Gradio Lite.

In the Space hardware settings, select ZeroGPU. The application uses spaces.GPU to request GPU access only while a translation is running.

The free-tier ZeroGPU environment is shared, so requests can queue and daily GPU usage is limited.

Architecture

Microphone / Upload
        ↓
DONDO / Khaya ASR
        ↓
Recognized text
        ↓
NLLB-200 distilled 600M
        ↓
Translated text
        ↓
Ghana-NLP Africa TTS
        ↓
Translated speech

Supported languages

  • English
  • French
  • Ga
  • Asante Twi
  • Ewe
  • Fante
  • Hausa
  • Dagbani

Translation is bidirectional: any listed language can be selected as source or target, subject to the capabilities of the selected ASR/TTS models.

Models

Southern Ghana ASR

KhayaAI/w2v-bert-ada_ewe_fat_fra_gaa_nzi_twi_en

Used for English, French, Ga, Asante Twi, Ewe and Fante.

Hausa ASR

KhayaAI/w2v-bert-hau_pcm_wol_en_fra

Used for Hausa.

Northern Ghana ASR

KhayaAI/w2v-bert-gjn_maw_gur_dag_dga_kus_lxn_wlx_xon_xsm_en

Used for Dagbani.

Translation

facebook/nllb-200-distilled-600M

Speech synthesis

Ghana-NLP/Africa-TTS-Staging

The TTS adapter uses the public Ghana-NLP Africa TTS Gradio API.

Space Secret

If the Ghana-NLP TTS Space requires authentication, add this in Settings β†’ Variables and secrets:

HF_TOKEN=hf_your_token_here

Never put the token in app.py or commit it to the repository.

Deployment

  1. Create a new Hugging Face Gradio Space.
  2. If the account offers it, select ZeroGPU as the hardware.
  3. Upload every file in this repository to the root of the Space.
  4. Make sure app.py is at the repository root.
  5. Add HF_TOKEN as a Space Secret if required by the TTS backend.
  6. Commit the files and wait for the Space to build.
  7. Open the app and test a short 5–10 second recording first.

Why this is not Gradio Lite

Do not open or configure this project as a static/Gradio-Lite browser application. The translator needs server-side Python, PyTorch, Transformers and model inference.

ZeroGPU implementation

GPU-dependent work is wrapped by:

@spaces.GPU(duration=180)
def run_translation(...):
    ...

The ASR and NLLB models are loaded at application startup and placed on CUDA so ZeroGPU can pack their weights efficiently. Actual inference occurs inside the GPU-decorated function.

User interface

  • Microphone input
  • Audio upload
  • Source language selection
  • Target language selection
  • Language swap button
  • Female / Male Low / Male High voice selection
  • Recognized speech display
  • Translated text display
  • Translated audio playback
  • Audio download through the Gradio audio component

Important ASR limitation

DONDO is language-conditioned. The current checkpoints require the source language to be selected; this version does not claim automatic language identification.

Project structure

khaya-live-translator/
β”œβ”€β”€ app.py
β”œβ”€β”€ pipeline.py
β”œβ”€β”€ asr.py
β”œβ”€β”€ translation.py
β”œβ”€β”€ tts.py
β”œβ”€β”€ language_map.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ .gitattributes
└── .gitignore

Hardware integration

The backend is separated into ASR, translation and TTS modules so it can later be connected to the planned hardware translator, microphone/mixer input and professional audio output system.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support