Views
No views yet
| File | Purpose |
|---|---|
model_last.pth | Trained model weights. |
config.json | Coqui TTS model configuration. |
speakers.pth | Speaker ID → embedding mapping. |
pip install TTS1import torch
2from huggingface_hub import hf_hub_download
3from TTS.tts.utils.speakers import SpeakerManager
4from TTS.utils.synthesizer import Synthesizer
5
6repo_id = "multilingual-tts/VITS-OpenBible-Gamo"
7ckpt = hf_hub_download(repo_id, "model_last.pth")
8config = hf_hub_download(repo_id, "config.json")
9speakers = hf_hub_download(repo_id, "speakers.pth")
10
11use_cuda = torch.cuda.is_available()
12synthesizer = Synthesizer(
13 tts_checkpoint=ckpt,
14 tts_config_path=config,
15 tts_speakers_file=speakers,
16 use_cuda=use_cuda,
17)
18
19# Coqui's Synthesizer may not inject the speakers file into the model config
20# automatically — restore the SpeakerManager manually when needed.
21if synthesizer.tts_model.speaker_manager is None:
22 synthesizer.tts_model.speaker_manager = SpeakerManager(
23 speaker_id_file_path=speakers
24 )
25
26# List available speaker names
27print(sorted(synthesizer.tts_model.speaker_manager.speaker_names))
28
29wav = synthesizer.tts(
30 text="...", # text to synthesise in Gamo
31 speaker_name="...", # one of the speaker names printed above
32 split_sentences=True,
33)davidguzmanr/open-bible-resources, config Gamo