diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 98e48a2a..491d6679 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -292,15 +292,20 @@ class ModelManager(object): else: os.makedirs(output_path, exist_ok=True) print(f" > Downloading model to {output_path}") - # download from fairseq - if "fairseq" in model_name: - self.download_fairseq_model(model_name, output_path) - else: - # download from github release - if isinstance(model_item["github_rls_url"], list): - self._download_model_files(model_item["github_rls_url"], output_path, self.progress_bar) + try: + # download from fairseq + if "fairseq" in model_name: + self.download_fairseq_model(model_name, output_path) else: - self._download_zip_file(model_item["github_rls_url"], output_path, self.progress_bar) + # download from github release + if isinstance(model_item["github_rls_url"], list): + self._download_model_files(model_item["github_rls_url"], output_path, self.progress_bar) + else: + self._download_zip_file(model_item["github_rls_url"], output_path, self.progress_bar) + except requests.Exception.RequestException as e: + print(f" > Failed to download the model file to {output_path}") + rmtree(output_path) + raise e self.print_model_license(model_item=model_item) # find downloaded files output_model_path = output_path