From 166f0aeb9a5e0fc16231f67f468283d6b1dffa08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 7 Jun 2021 15:11:33 +0200 Subject: [PATCH] merge if branches with the same implementation --- TTS/tts/utils/synthesis.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/TTS/tts/utils/synthesis.py b/TTS/tts/utils/synthesis.py index 46f919dc..9064811a 100644 --- a/TTS/tts/utils/synthesis.py +++ b/TTS/tts/utils/synthesis.py @@ -248,15 +248,11 @@ def synthesis( style_mel = numpy_to_torch(style_mel, torch.float, cuda=use_cuda) text_inputs = numpy_to_torch(text_inputs, torch.long, cuda=use_cuda) text_inputs = text_inputs.unsqueeze(0) - elif backend == "tf": + elif backend in ["tf", "tflite"]: # TODO: handle speaker id for tf model style_mel = numpy_to_tf(style_mel, tf.float32) text_inputs = numpy_to_tf(text_inputs, tf.int32) text_inputs = tf.expand_dims(text_inputs, 0) - elif backend == "tflite": - style_mel = numpy_to_tf(style_mel, tf.float32) - text_inputs = numpy_to_tf(text_inputs, tf.int32) - text_inputs = tf.expand_dims(text_inputs, 0) # synthesize voice if backend == "torch": outputs = run_model_torch(model, text_inputs, speaker_id, style_mel, d_vector=d_vector)