Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit dd612fd
Author: JiangCheng <[email protected]>
Date:   Mon Jun 5 16:04:54 2023 +0800

    Failed to download the file and need to delete the created file path
  • Loading branch information
erogol committed Jul 5, 2023
1 parent e42a72e commit 0a92f23
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions TTS/utils/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,19 @@ def download_model(self, model_name):
else:
os.makedirs(output_path, exist_ok=True)
print(f" > Downloading model to {output_path}")
if "fairseq" in model_name:
self.download_fairseq_model(model_name, output_path)
elif "github_rls_url" in model_item:
self._download_github_model(model_item, output_path)
elif "hf_url" in model_item:
self._download_hf_model(model_item, output_path)

self.print_model_license(model_item=model_item)
try:
if "fairseq" in model_name:
self.download_fairseq_model(model_name, output_path)
elif "github_rls_url" in model_item:
self._download_github_model(model_item, output_path)
elif "hf_url" in model_item:
self._download_hf_model(model_item, output_path)

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
output_config_path = None
Expand Down

0 comments on commit 0a92f23

Please sign in to comment.