YaTharThShaRma999's picture
Create voice.py
c0b86f9 verified
raw
history blame
No virus
399 Bytes
from styletts2 import tts
class style_tts:
def __init__(self, model_path="epochs_2nd_00020.pth", config_path='config.yml'):
self.speech_model = tts.StyleTTS2(model_checkpoint_path=model_path, config_path=config_path)
def infer(self, prompt, voice, out="another_test.wav"):
self.speech_model.inference(prompt, target_voice_path=voice, output_wav_file=out)
return out