From 903627275d50887e90a4b2b0874d46834dd358bb Mon Sep 17 00:00:00 2001 From: Florian Lux Date: Wed, 13 Dec 2023 15:20:27 +0100 Subject: [PATCH] fix popping noise and incorrect path in downloader --- InferenceInterfaces/ToucanTTSInterface.py | 2 ++ run_model_downloader.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/InferenceInterfaces/ToucanTTSInterface.py b/InferenceInterfaces/ToucanTTSInterface.py index 12499b8e..bbea17d3 100644 --- a/InferenceInterfaces/ToucanTTSInterface.py +++ b/InferenceInterfaces/ToucanTTSInterface.py @@ -177,6 +177,8 @@ def forward(self, energy_variance_scale=energy_variance_scale, pause_duration_scaling_factor=pause_duration_scaling_factor) # codec_frames=self.codec_wrapper.model.quantizer(codec_frames.unsqueeze(0))[0].squeeze() # re-quantization + mel = mel[:, durations[0]:] + durations[0] = 0 wave, _, _ = self.vocoder(mel.unsqueeze(0)) wave = wave.squeeze().cpu().numpy() diff --git a/run_model_downloader.py b/run_model_downloader.py index ccf82dfd..59aa7e76 100644 --- a/run_model_downloader.py +++ b/run_model_downloader.py @@ -25,10 +25,10 @@ def download_models(): ############# print("Downloading ASVSpoof ToucanTTS Model") - os.makedirs(os.path.join(MODELS_DIR, "ASVSpoof"), exist_ok=True) + os.makedirs(os.path.join(MODELS_DIR, "ToucanTTS_ASVSpoof"), exist_ok=True) filename, headers = urllib.request.urlretrieve( url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.asvspoof/toucantts.pt", - filename=os.path.abspath(os.path.join(MODELS_DIR, "ASVSpoof", "best.pt")), + filename=os.path.abspath(os.path.join(MODELS_DIR, "ToucanTTS_ASVSpoof", "best.pt")), reporthook=report) #############