From 562a9509f253a7a40d8769940a94096aacbb3fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 4 Sep 2023 13:57:03 +0200 Subject: [PATCH] Add BE model --- TTS/.models.json | 4 ++-- TTS/utils/manage.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TTS/.models.json b/TTS/.models.json index 02873e7b..c39c39fc 100644 --- a/TTS/.models.json +++ b/TTS/.models.json @@ -720,7 +720,7 @@ "common-voice": { "glow-tts":{ "description": "Belarusian GlowTTS model created by @alex73 (Github).", - "hf_url":"", + "github_rls_url":"https://coqui.gateway.scarf.sh/v0.16.6/tts_models--be--common-voice--glow-tts.zip", "default_vocoder": "vocoder_models/be/common-voice/hifigan", "commit": "c0aabb85", "license": "CC-BY-SA 4.0", @@ -882,7 +882,7 @@ "be": { "common-voice": { "hifigan": { - "hf_url": "https://huggingface.co/coqui/hifigan-be", + "github_rls_url": "https://coqui.gateway.scarf.sh/v0.16.6/vocoder_models--be--common-voice--hifigan.zip", "description": "Belarusian HiFiGAN model created by @alex73 (Github).", "author": "@alex73", "license": "CC-BY-SA 4.0", diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 70d35228..be393adb 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -468,13 +468,16 @@ class ModelManager(object): print(f" > Error: Bad zip file - {file_url}") raise zipfile.BadZipFile # pylint: disable=raise-missing-from # move the files to the outer path - for file_path in z.namelist()[1:]: + for file_path in z.namelist(): src_path = os.path.join(output_folder, file_path) - dst_path = os.path.join(output_folder, os.path.basename(file_path)) - if src_path != dst_path: - copyfile(src_path, dst_path) - # remove the extracted folder - rmtree(os.path.join(output_folder, z.namelist()[0])) + if os.path.isfile(src_path): + dst_path = os.path.join(output_folder, os.path.basename(file_path)) + if src_path != dst_path: + copyfile(src_path, dst_path) + # remove redundant (hidden or not) folders + for file_path in z.namelist(): + if os.path.isdir(os.path.join(output_folder, file_path)): + rmtree(os.path.join(output_folder, file_path)) @staticmethod def _download_tar_file(file_url, output_folder, progress_bar):