TTS_evaluation_tool / models /f5tts_model.py
PaulineDV's picture
new model kokoro working + piper test
8769d0e
Raw
History Blame Contribute Delete
491 Bytes
from f5_tts.api import F5TTS
import tempfile
from config.settings import (
REFERENCE_AUDIO,
REFERENCE_TEXT
)
print("Loading F5-TTS...")
model = F5TTS()
print("F5-TTS loaded")
def generate(sentence):
output_wav = tempfile.mktemp(
suffix = ".wav"
)
model.infer(
ref_file = REFERENCE_AUDIO,
ref_text = REFERENCE_TEXT,
gen_text = sentence,
file_wave = output_wav,
remove_silence = False,
)
return output_wav