Ghana Voice
Collection
Official suite of Ghanaian and African text-to-speech models (Zero-Ref IPA + GGUF CPU) built on ghana-voice-base. • 10 items • Updated
How to use ghanaopenai/ghana-voice-base with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ghanaopenai/ghana-voice-base:Q4_K_M # Run inference directly in the terminal: llama cli -hf ghanaopenai/ghana-voice-base:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ghanaopenai/ghana-voice-base:Q4_K_M # Run inference directly in the terminal: llama cli -hf ghanaopenai/ghana-voice-base:Q4_K_M
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ghanaopenai/ghana-voice-base:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf ghanaopenai/ghana-voice-base:Q4_K_M
docker model run hf.co/ghanaopenai/ghana-voice-base:Q4_K_M
How to use ghanaopenai/ghana-voice-base with Ollama:
ollama run hf.co/ghanaopenai/ghana-voice-base:Q4_K_M
How to use ghanaopenai/ghana-voice-base with Docker Model Runner:
docker model run hf.co/ghanaopenai/ghana-voice-base:Q4_K_M
How to use ghanaopenai/ghana-voice-base with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ghanaopenai/ghana-voice-base:Q4_K_M
lemonade run user.ghana-voice-base-Q4_K_M
lemonade list
Configuration Parsing Warning:Config file tokenizer_config.json cannot be fetched (too big)
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.
akʷaaba, oɲankʰopʰɔn)., . ? ! ; :) is preserved for natural pauses and rhythm.twi)twi)fat)gaa)ewe)dag)dga)gur)nzi)aha)sfw)ada)eng)neuphonic/neucodec into 24 kHz high-fidelity audio.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!")
Fine-tuned and exported using GhanaOpenAI/ghana-voice-trainer.