fixed error if parent directory doesn't exist #988 (#990)

Create missing parent directory
This commit is contained in:
vadimdddd
2022-06-01 17:52:16 +03:00
committed by GitHub
parent b1b216d4c8
commit 630edeb3d6
+2 -2
View File
@@ -98,8 +98,8 @@ class Model(object):
return Path(directory, result_model[0])
def download_model(self, model_name):
if not MODEL_DIRS[3].exists():
MODEL_DIRS[3].mkdir()
if not (model_name.parent).exists():
(model_name.parent).mkdir(parents=True)
with tqdm(unit='B', unit_scale=True, unit_divisor=1024, miniters=1,
desc=(MODEL_PRE_URL + str(model_name.name) + '.zip').split('/')[-1]) as t:
reporthook = self.download_progress_hook(t)