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
- Direct Zero-Reference TTS: Direct text-to-speech generation without needing reference audio prompts or reference acoustic tokens.
- 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).
- Inside each word, characters have NO spaces (
- 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)
- Asante Twi (
- NeuCodec Audio Decoding: Generates discrete acoustic tokens at 50 Hz frame rate, decoded with
neuphonic/neucodecinto 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.