From 85a822e3190f6c7207c28f7485ecb0ebe7e480ba Mon Sep 17 00:00:00 2001 From: mittimithai Date: Tue, 12 May 2020 15:02:24 -0700 Subject: [PATCH 1/4] small change for multispeaker just threads speaker_id through decoder.run_model --- server/synthesizer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/synthesizer.py b/server/synthesizer.py index e9205bf1..411be928 100644 --- a/server/synthesizer.py +++ b/server/synthesizer.py @@ -164,16 +164,21 @@ class Synthesizer(object): sentences = list(filter(None, [s.strip() for s in sentences])) # remove empty sentences return sentences - def tts(self, text): + def tts(self, text, speaker_id=None): wavs = [] sens = self.split_into_sentences(text) print(sens) + + speaker_id = id_to_torch(speaker_id) ++ if speaker_id is not None and self.use_cuda: ++ speaker_id = speaker_id.cuda() + for sen in sens: # preprocess the given text inputs = text_to_seqvec(sen, self.tts_config, self.use_cuda) # synthesize voice decoder_output, postnet_output, alignments, _ = run_model( - self.tts_model, inputs, self.tts_config, False, None, None) + self.tts_model, inputs, self.tts_config, False, speaker_id, None) # convert outputs to numpy postnet_output, decoder_output, _ = parse_outputs( postnet_output, decoder_output, alignments) From a4aca623c34243e065bd49ee5520fd714e461c1a Mon Sep 17 00:00:00 2001 From: mittimithai Date: Tue, 12 May 2020 15:23:45 -0700 Subject: [PATCH 2/4] removed + chars silly mistake copy pasting --- server/synthesizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/synthesizer.py b/server/synthesizer.py index 411be928..dee2cd4b 100644 --- a/server/synthesizer.py +++ b/server/synthesizer.py @@ -170,8 +170,8 @@ class Synthesizer(object): print(sens) speaker_id = id_to_torch(speaker_id) -+ if speaker_id is not None and self.use_cuda: -+ speaker_id = speaker_id.cuda() + if speaker_id is not None and self.use_cuda: + speaker_id = speaker_id.cuda() for sen in sens: # preprocess the given text From 42ff83f9b9e1151ccaba6d7f9d8f520d274a0d31 Mon Sep 17 00:00:00 2001 From: mittimithai Date: Tue, 12 May 2020 18:50:58 -0700 Subject: [PATCH 3/4] trying to fix trailing whitespace --- server/synthesizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/synthesizer.py b/server/synthesizer.py index dee2cd4b..3035a287 100644 --- a/server/synthesizer.py +++ b/server/synthesizer.py @@ -172,7 +172,7 @@ class Synthesizer(object): speaker_id = id_to_torch(speaker_id) if speaker_id is not None and self.use_cuda: speaker_id = speaker_id.cuda() - + for sen in sens: # preprocess the given text inputs = text_to_seqvec(sen, self.tts_config, self.use_cuda) From 25f466f2994dad707f0aa00db36187d6a43844ee Mon Sep 17 00:00:00 2001 From: mittimithai Date: Tue, 12 May 2020 19:02:37 -0700 Subject: [PATCH 4/4] more whitespace problems --- server/synthesizer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/server/synthesizer.py b/server/synthesizer.py index 3035a287..453e5827 100644 --- a/server/synthesizer.py +++ b/server/synthesizer.py @@ -168,7 +168,6 @@ class Synthesizer(object): wavs = [] sens = self.split_into_sentences(text) print(sens) - speaker_id = id_to_torch(speaker_id) if speaker_id is not None and self.use_cuda: speaker_id = speaker_id.cuda()