mirror of https://github.com/coqui-ai/TTS.git
downloading models from github releases
This commit is contained in:
parent
fc19411ac6
commit
599149a7e5
|
@ -3,6 +3,7 @@ import json
|
||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from shutil import copyfile
|
||||||
|
|
||||||
import gdown
|
import gdown
|
||||||
import requests
|
import requests
|
||||||
|
@ -130,11 +131,14 @@ class ModelManager(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _download_zip_file(file_url, output):
|
def _download_zip_file(file_url, output):
|
||||||
"""Download the target zip file and extract the files
|
"""Download the github releases"""
|
||||||
to a folder with the same name as the zip file."""
|
|
||||||
r = requests.get(file_url)
|
r = requests.get(file_url)
|
||||||
z = zipfile.ZipFile(io.BytesIO(r.content))
|
z = zipfile.ZipFile(io.BytesIO(r.content))
|
||||||
z.extractall(output)
|
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
|
@staticmethod
|
||||||
def _check_dict_key(my_dict, key):
|
def _check_dict_key(my_dict, key):
|
||||||
|
|
Loading…
Reference in New Issue