How to use from
Docker Model Runner
docker model run hf.co/ghanaopenai/ghana-voice-base:Q4_K_M
Quick Links

Configuration Parsing Warning:Config file tokenizer_config.json cannot be fetched (too big)

Neu-TTS Ghana Foundation Base Model (Zero-Ref IPA)

ghanaopenai/neu-tts-ghana-base is the multilingual text-to-speech foundation base model for Ghanaian languages, operating in direct zero-reference mode (no reference audio prompt required).

Trained to full convergence using Joint Loss + CER Plateau detection across 12,695 clean, digit-free speech clips selected from AfriSpeech Selector.


Key Features

  1. Direct Zero-Reference TTS: Direct text-to-speech generation without needing reference audio prompts or reference acoustic tokens.
  2. Word-Separated IPA Conditioning:
    • Inside each word, characters have NO spaces (akʷaaba, oɲankʰopʰɔn).
    • Words are separated by single spaces.
    • Punctuation (, . ? ! ; :) is preserved for natural pauses and rhythm.
    • Zero language tags (pure phonetic conditioning).
  3. 13 Ghanaian Languages Supported:
    • Asante Twi (twi)
    • Akuapem Twi (twi)
    • Fante (fat)
    • Ga (gaa)
    • Ewe (ewe)
    • Dagbani (dag)
    • Dagaare (dga)
    • Frafra / Farefare (gur)
    • Nzema (nzi)
    • Ahanta (aha)
    • Sehwi (sfw)
    • Dangme (ada)
    • Ghanaian English (eng)
  4. NeuCodec Audio Decoding: Generates discrete acoustic tokens at 50 Hz frame rate, decoded with neuphonic/neucodec into 24 kHz high-fidelity audio.

Quickstart Inference

import torch
import soundfile as sf
import re
from transformers import AutoModelForCausalLM, AutoTokenizer
from africa_g2p import AfricaPipeline
from neucodec import NeuCodec

device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "ghanaopenai/neu-tts-ghana-base"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map=device)
codec = NeuCodec.from_pretrained("neuphonic/neucodec").to(device).eval()

# 1. Phonemize text to word-separated IPA
pipe = AfricaPipeline(lang="twi", output="ipa")
ipa_text = pipe.run("Akwaaba, yɛbɔ mpae sɛ Onyankopɔn bɛhyira wo.", sep="").strip()

# 2. Format zero-reference prompt
prompt = f"<|TEXT_PROMPT_START|>{ipa_text}<|TEXT_PROMPT_END|><|SPEECH_GENERATION_START|>"
input_ids = tokenizer.encode(prompt, return_tensors="pt").to(device)

# 3. Generate speech tokens
speech_end_id = tokenizer.convert_tokens_to_ids("<|SPEECH_GENERATION_END|>")
out = model.generate(
    input_ids,
    eos_token_id=speech_end_id,
    max_new_tokens=400,
    do_sample=True,
    temperature=0.7,
    top_p=0.8,
    repetition_penalty=1.05
)

# 4. Decode with NeuCodec
gen_str = tokenizer.decode(out[0, input_ids.shape[1]:], add_special_tokens=False)
speech_ids = [int(n) for n in re.findall(r"<\|speech_(\d+)\|>", gen_str)]
sp_t = torch.tensor(speech_ids, device=device).unsqueeze(0).unsqueeze(0)
wav = codec.decode_code(sp_t).squeeze().cpu().float().numpy()

sf.write("output.wav", wav, 24000)
print("Saved output.wav!")

Training Framework

Fine-tuned and exported using GhanaOpenAI/ghana-voice-trainer.

Downloads last month
172
Safetensors
Model size
0.2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ghanaopenai/ghana-voice-base

Adapters
9 models

Spaces using ghanaopenai/ghana-voice-base 2

Collection including ghanaopenai/ghana-voice-base