mirror of https://github.com/coqui-ai/TTS.git
Failed to download the file and need to delete the created file path
This commit is contained in:
parent
2d967b786d
commit
dd612fd72e
|
@ -292,15 +292,20 @@ class ModelManager(object):
|
||||||
else:
|
else:
|
||||||
os.makedirs(output_path, exist_ok=True)
|
os.makedirs(output_path, exist_ok=True)
|
||||||
print(f" > Downloading model to {output_path}")
|
print(f" > Downloading model to {output_path}")
|
||||||
# download from fairseq
|
try:
|
||||||
if "fairseq" in model_name:
|
# download from fairseq
|
||||||
self.download_fairseq_model(model_name, output_path)
|
if "fairseq" in model_name:
|
||||||
else:
|
self.download_fairseq_model(model_name, output_path)
|
||||||
# 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:
|
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)
|
self.print_model_license(model_item=model_item)
|
||||||
# find downloaded files
|
# find downloaded files
|
||||||
output_model_path = output_path
|
output_model_path = output_path
|
||||||
|
|
Loading…
Reference in New Issue