Views
No views yet
| Base model | F5-TTS (SWivid/F5-TTS) |
| Language | Yoruba (yo) |
| Training data | 200 hours of Yoruba speech |
| Architecture | Flow matching (DiT) |
| Task | Text-to-speech, zero-shot voice cloning |
| Sample rate | 24 kHz |
| License | CC-BY-NC-4.0 |
pip install f5-tts1from f5_tts.infer.utils_infer import (
2 infer_process,
3 load_model,
4 load_vocoder,
5 preprocess_ref_audio_text,
6)
7from f5_tts.model import DiT
8
9# Load vocoder
10vocoder = load_vocoder(vocoder_name="vocos", is_local=False, device="cuda")
11
12# Load fine-tuned Yoruba model
13ema_model = load_model(
14 DiT,
15 dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4),
16 ckpt_path="path/to/model.pt", # downloaded from this repo
17 mel_spec_type="vocos",
18 device="cuda",
19)
20
21# Provide a reference audio clip of the target Yoruba speaker
22ref_audio, ref_text = preprocess_ref_audio_text(
23 ref_audio_path="yoruba_speaker.wav",
24 ref_text="Transcript of the reference audio in Yoruba.", # or leave "" for auto-transcription
25)
26
27# Synthesize in the cloned voice
28audio, sample_rate, _ = infer_process(
29 ref_audio=ref_audio,
30 ref_text=ref_text,
31 gen_text="Ẹ káàárọ̀, báwo ni ẹ ṣe wà?", # Yoruba text to synthesize
32 model_obj=ema_model,
33 vocoder=vocoder,
34 mel_spec_type="vocos",
35 speed=1.0,
36 nfe_step=32,
37 cfg_strength=2.0,
38 device="cuda",
39)
40
41import soundfile as sf
42sf.write("output.wav", audio, sample_rate)1f5-tts_infer-cli \
2 --model path/to/model.pt \
3 --ref_audio yoruba_speaker.wav \
4 --ref_text "Transcript of reference audio." \
5 --gen_text "Ẹ káàárọ̀, báwo ni ẹ ṣe wà?"1@article{chen-etal-2024-f5tts,
2 title={F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching},
3 author={Yushen Chen and Zhikang Niu and Ziyang Ma and Keqi Deng and Chunhui Wang and Jian Zhao and Kai Yu and Xie Chen},
4 journal={arXiv preprint arXiv:2410.06885},
5 year={2024}
6}