Views
No views yet
F5TTS_v1_Base, Emilia-pretrained). Flow-matching DiT (1024-dim, 22 layers) +
Vocos vocoder, 24 kHz mono, character
tokenizer. It is reference-conditioned (zero-shot): it speaks the target text in the voice of a
short reference clip (3–10 s). An embedded reference (reference.wav) is included so it works
text-only out of the box.sw, n=25). See the benchmark below.stem-content-ai-project/swahili-speech.| File | Description |
|---|---|
model.safetensors | Pruned EMA weights (finetune of F5TTS_v1_Base) |
vocab.txt | Character vocab (reused from the Emilia base) |
reference.wav / reference.txt | Embedded reference clip + transcript (Safari voice, ~6.9 s) |
sw).
Only the finetuning data changes (all share the F5TTS_v1_Base Emilia base). Lower is better.| # | Finetuning data | Eff. hours | CER (raw) | WER (raw) |
|---|---|---|---|---|
| 1 | none — F5TTS_v1_Base zero-shot (Emilia: EN/ZH only) | 0 | 0.175 (0.175) | 0.638 (0.639) |
| 2 | + ~1.5 h studio (Safari/Toby) | ~1.5 | 0.173 (0.174) | 0.622 (0.624) |
| 3 | + FLEURS-R sw | 10.6 | 0.080 (0.087) | 0.346 (0.369) |
| 4 | + FLEURS + studio (overweighted 3×) | 15.2 | 0.043 (0.051) | 0.268 (0.285) |
| 5 | + Common Voice + FLEURS + studio ⭐ (this model) | 29.3 | 0.029 (0.039) | 0.202 (0.228) |
Headline numbers are text-normalized (punctuation stripped, digits expanded on both the reference and the ASR hypothesis — standard TTS-eval practice, cf. Seed-TTS eval / Whisper normalizers). Raw lowercase-only scores in parentheses: they count ASR-added punctuation and digit re-formatting as errors, inflating CER ~25% relative at this level.
ng', ny, dh, prenasalized stops).sw mis-spells/segments, so WER over-states errors. CER
and listening are the reliable signals.Methodology note: the common set is the published model's held-out split; older models pre-date it, so any overlap with their training would flatter them — the swbase margin is therefore conservative. Numbers were produced with this repo's eval (synthesize → Whisper-large-v3sw→ CER/WER vs target).
1from huggingface_hub import hf_hub_download
2from f5_tts.api import F5TTS # pip install f5-tts
3
4repo = "stem-content-ai-project/f5-tts-sw"
5ckpt = hf_hub_download(repo, "model.safetensors")
6vocab = hf_hub_download(repo, "vocab.txt")
7ref = hf_hub_download(repo, "reference.wav")
8ref_text = "Shughuli za mwovodhaji zilisaidia katika uokoaji wa samahani zilizozama."
9
10tts = F5TTS(model="F5TTS_v1_Base", ckpt_file=ckpt, vocab_file=vocab)
11
12# 1) PRE-PROCESS the text (see below), then 2) synthesize.
13gen_text = preprocess("Piga *149*00# kulipa shilingi 2500.") # -> Swahili words
14wav, sr, _ = tts.infer(ref_file=ref, ref_text=ref_text, gen_text=gen_text)ref_file / ref_text (3–10 s of clean speech)., . ? ! ' - punctuation appears — it never saw digit/symbol glyphs. Real input has digits, %,
USSD codes, etc., so normalize first. This is a sample, swappable heuristic — call it in sequence
before infer, or drop in your own frontend:1import re
2
3ONES = ["sifuri","moja","mbili","tatu","nne","tano","sita","saba","nane","tisa"]
4TENS = {10:"kumi",20:"ishirini",30:"thelathini",40:"arobaini",50:"hamsini",
5 60:"sitini",70:"sabini",80:"themanini",90:"tisini"}
6SYM = {"*":" nyota ","#":" alama ya reli ","/":" kwa ","+":" jumlisha ",
7 "=":" sawa na ","&":" na ","@":" at ","_":" "}
8_KEEP = re.compile(r"[^A-Za-zÀ-ſ .,?!'\-]")
9
10def _two(n): return ONES[n] if n<10 else TENS.get(n) or f"{TENS[n//10*10]} na {ONES[n%10]}"
11def _three(n):
12 h,r=divmod(n,100); p=[]
13 if h: p+=["mia",ONES[h]]
14 if r: p.append(("na "+_two(r)) if h else _two(r))
15 return " ".join(p)
16def cardinal(n):
17 if n==0: return "sifuri"
18 p=[]
19 for v,name in [(10**9,"bilioni"),(10**6,"milioni"),(1000,"elfu")]:
20 if n>=v: q,n=divmod(n,v); p.append(f"{name} {_three(q)}")
21 if n: p.append(("na "+_three(n)) if p and n<100 else _three(n))
22 return " ".join(p)
23def digits(s): return " ".join(ONES[int(c)] for c in s if c.isdigit())
24def _num(t): return digits(t) if (len(t)>=5 or t.startswith("0")) else cardinal(int(t))
25
26def preprocess(text: str) -> str:
27 text = text.strip()
28 text = re.sub(r"\*[\d*#]*#", lambda m: " "+re.sub(r"\d+",lambda d:digits(d.group()),m.group())+" ", text) # USSD *149*00#
29 text = re.sub(r"(\d+)\s*%", lambda m: " asilimia "+cardinal(int(m.group(1)))+" ", text) # 50% -> asilimia hamsini
30 for s,w in SYM.items(): text = text.replace(s,w) # symbols -> words
31 text = re.sub(r"\d+", lambda m: " "+_num(m.group())+" ", text) # remaining numbers
32 text = _KEEP.sub(" ", text) # drop unknown glyphs
33 text = re.sub(r"\s+([,.?!])", r"\1", re.sub(r"\s+"," ",text)).strip()
34 return text| Input | preprocess(...) |
|---|---|
Piga *606# kuangalia salio. | Piga nyota sita sifuri sita alama ya reli kuangalia salio. |
Lipa shilingi 2500 kwa siku. | Lipa shilingi elfu mbili na mia tano kwa siku. |
Punguzo la 50% leo. | Punguzo la asilimia hamsini leo. |
Akaunti 0712345678. | Akaunti sifuri saba moja mbili tatu nne tano sita saba nane. |
% → asilimia N; USSD
*…# → every digit spoken; unsupported glyphs are dropped.F5TTS_v1_Base (finetune), char tokenizer, Vocos @ 24 kHz, bf16 + TF32, batch 3200 frames.sw (cleaned) + Common Voice sw v17 (cleaned + quality-filtered)
sw) → CER/WER vs the target text, with text normalization (punctuation strip + digit expansion)
applied to both sides before scoring.runs/ — see the Metrics tab on this page.| Source | License | Role |
|---|---|---|
FLEURS-R sw | CC-BY-4.0 | pronunciation breadth (Kenyan-leaning) |
Common Voice sw v17 | CC0 | scale + Tanzanian-accent breadth |
Safari (stem-content-ai-project/swahili-speech) | — | studio target; embedded voice |
| Toby | Vodacom (internal) | IVR-domain influence only |
2500, %, *…# are unseen glyphs and come out
wrong or dropped.sw mis-spells); use CER + listening.ref_text accurate.vocab.txt (the char set the
weights expect).torchaudio.load dispatches to
torchcodec and fails to find FFmpeg — read audio via soundfile instead (monkeypatch
torchaudio.load), and for ASR use WhisperProcessor + model.generate rather than the
transformers pipeline (which hard-imports torchcodec).ng', prenasalized stops); a
domain pronunciation lexicon helps for brand/technical terms.F5TTS_v1_Base (Emilia) base model.
Single embedded voice (Safari); for other voices supply your own reference.stem-content-ai-project/swahili-speech corpus.