From 9ab07f94e2475264a94a7293b9259d6b32ccf796 Mon Sep 17 00:00:00 2001 From: kirianguiller Date: Tue, 16 Feb 2021 17:25:18 +0100 Subject: [PATCH] modify according to PR reviews --- TTS/tts/datasets/preprocess.py | 11 ++++++++--- TTS/tts/utils/chinese_mandarin/numbers.py | 2 +- TTS/tts/utils/synthesis.py | 1 - TTS/utils/synthesizer.py | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TTS/tts/datasets/preprocess.py b/TTS/tts/datasets/preprocess.py index 01a3ce1c..7cb4edc1 100644 --- a/TTS/tts/datasets/preprocess.py +++ b/TTS/tts/datasets/preprocess.py @@ -372,10 +372,15 @@ def _voxcel_x(root_path, meta_file, voxcel_idx): +def baker(root_path: str, meta_file: str) -> List[List[str]]: + """Normalizes the Baker meta data file to TTS format -# ======================================== Baker (chinese mandarin single speaker) =========================================== -def baker(root_path, meta_file): - """Normalizes the Baker meta data file to TTS format""" + Args: + root_path (str): path to the baker dataset + meta_file (str): name of the meta dataset containing names of wav to select and the transcript of the sentence + Returns: + List[List[str]]: List of (text, wav_path, speaker_name) associated with each sentences + """ txt_file = os.path.join(root_path, meta_file) items = [] speaker_name = "baker" diff --git a/TTS/tts/utils/chinese_mandarin/numbers.py b/TTS/tts/utils/chinese_mandarin/numbers.py index 0befe6b1..a662ea1c 100644 --- a/TTS/tts/utils/chinese_mandarin/numbers.py +++ b/TTS/tts/utils/chinese_mandarin/numbers.py @@ -105,7 +105,7 @@ def _num2chinese(num :str, big=False, simp=True, o=False, twoalt=False) -> str: -def _number_replace(match) -> str: +def _number_replace(match: re.Match) -> str: """function to apply in a match, transform all numbers in a match by chinese characters Args: diff --git a/TTS/tts/utils/synthesis.py b/TTS/tts/utils/synthesis.py index f407f605..b35c7db3 100644 --- a/TTS/tts/utils/synthesis.py +++ b/TTS/tts/utils/synthesis.py @@ -220,7 +220,6 @@ def synthesis(model, model outputs. speaker_id (int): id of speaker style_wav (str | Dict[str, float]): Uses for style embedding of GST. - style_wav (str): Uses for style embedding of GST. truncated (bool): keep model states after inference. It can be used for continuous inference at long texts. enable_eos_bos_chars (bool): enable special chars for end of sentence and start of sentence. diff --git a/TTS/utils/synthesizer.py b/TTS/utils/synthesizer.py index 4b4bc04c..3e65e175 100644 --- a/TTS/utils/synthesizer.py +++ b/TTS/utils/synthesizer.py @@ -127,7 +127,7 @@ class Synthesizer(object): gst_style_input = None if self.tts_config.use_gst: if self.tts_config.gst["gst_style_input"] not in ["", {}]: - style_wav = self.tts_config.gst["gst_style_input"] + gst_style_input = self.tts_config.gst["gst_style_input"] for sen in sens: # synthesize voice