remove unwanted formatting/functionality from the PR

This commit is contained in:
AUTOMATIC
2022-09-30 11:42:40 +03:00
parent 2552204fcb
commit d1f098540a
11 changed files with 127 additions and 175 deletions

View File

@@ -25,8 +25,10 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
if ext_filter is None:
ext_filter = []
try:
places = []
if command_path is not None and command_path != model_path:
pretrained_path = os.path.join(command_path, 'experiments/pretrained_models')
if os.path.exists(pretrained_path):
@@ -34,7 +36,9 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
places.append(pretrained_path)
elif os.path.exists(command_path):
places.append(command_path)
places.append(model_path)
for place in places:
if os.path.exists(place):
for file in os.listdir(place):
@@ -47,14 +51,17 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
continue
if file not in output:
output.append(full_path)
if model_url is not None and len(output) == 0:
if download_name is not None:
dl = load_file_from_url(model_url, model_path, True, download_name)
output.append(dl)
else:
output.append(model_url)
except:
except Exception:
pass
return output