From 599149a7e59e34be2c3f67f0d170821f1818cc8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Wed, 10 Mar 2021 11:09:01 +0100 Subject: [PATCH] downloading models from github releases --- TTS/utils/manage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 12f930ac..a65a3253 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -3,6 +3,7 @@ import json import os import zipfile from pathlib import Path +from shutil import copyfile import gdown import requests @@ -130,11 +131,14 @@ class ModelManager(object): @staticmethod def _download_zip_file(file_url, output): - """Download the target zip file and extract the files - to a folder with the same name as the zip file.""" + """Download the github releases""" r = requests.get(file_url) z = zipfile.ZipFile(io.BytesIO(r.content)) z.extractall(output) + for file_path in z.namelist()[1:]: + src_path = os.path.join(output, file_path) + dst_path = os.path.join(output, os.path.basename(file_path)) + copyfile(src_path, dst_path) @staticmethod def _check_dict_key(my_dict, key):