Refactor synthesis.py for TTSTokenizer

This commit is contained in:
Eren Gölge 2021-11-16 13:34:45 +01:00
parent 3476be30d7
commit d0eb642d88
1 changed files with 7 additions and 2 deletions

View File

@ -113,6 +113,11 @@ def synthesis(
text,
CONFIG,
use_cuda,
<<<<<<< HEAD
=======
ap,
tokenizer,
>>>>>>> Refactor synthesis.py for TTSTokenizer
speaker_id=None,
style_wav=None,
use_griffin_lim=False,
@ -164,10 +169,10 @@ def synthesis(
if isinstance(style_wav, dict):
style_mel = style_wav
else:
style_mel = compute_style_mel(style_wav, model.ap, cuda=use_cuda)
style_mel = compute_style_mel(style_wav, ap, cuda=use_cuda)
# convert text to sequence of token IDs
text_inputs = np.asarray(
model.tokenizer.text_to_ids(text),
tokenizer.text_to_ids(text),
dtype=np.int32,
)
# pass tensors to backend