From 0db3bc3be5953470863a73815f5fb61bbec0b401 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 27 Nov 2023 21:36:22 -0500 Subject: [PATCH] inference-job to send null or sentinel values for unused vocoders --- tts/tacotron2_v1_early_fakeyou/vocodes_common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tts/tacotron2_v1_early_fakeyou/vocodes_common.py b/tts/tacotron2_v1_early_fakeyou/vocodes_common.py index 05e6b22..26741dc 100644 --- a/tts/tacotron2_v1_early_fakeyou/vocodes_common.py +++ b/tts/tacotron2_v1_early_fakeyou/vocodes_common.py @@ -234,6 +234,9 @@ class FakeYouTt2Pipeline: self.hifigan_super_resolution_filename = None def maybe_load_hifigan(self, checkpoint_path): + if not checkpoint_path or checkpoint_path == 'BOGUS_NOT_USED': + # Requests no longer have to specify a hifigan to use (if using waveglow) + return if self.hifigan_filename == checkpoint_path: LOGGER.info('Hifi-gan model already loaded into memory: {}'.format(checkpoint_path)) return @@ -246,6 +249,9 @@ class FakeYouTt2Pipeline: self.hifigan_filename = checkpoint_path def maybe_load_hifigan_super_resolution(self, checkpoint_path): + if not checkpoint_path or checkpoint_path == 'BOGUS_NOT_USED': + # Requests no longer have to specify a hifigan to use (if using waveglow) + return if self.hifigan_super_resolution_filename == checkpoint_path: LOGGER.info('Hifi-gan (SuperRes) model already loaded into memory: {}'.format(checkpoint_path)) return @@ -258,6 +264,9 @@ class FakeYouTt2Pipeline: self.hifigan_super_resolution_filename = checkpoint_path def maybe_load_waveglow_model(self, checkpoint_path): + if not checkpoint_path or checkpoint_path == 'BOGUS_NOT_USED': + # Requests no longer have to specify a waveglow to use (if using hifigan) + return if self.waveglow_filename == checkpoint_path: LOGGER.info('Waveglow model already loaded into memory: {}'.format(checkpoint_path)) return