mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-23 06:39:50 +01:00
Bring back the earlier model scanning logic
This commit is contained in:
parent
e32b34e2f4
commit
78dcc7cb03
@ -438,17 +438,12 @@ def getModels(scan_for_malicious: bool = True):
|
||||
if not os.path.exists(models_dirs[0]):
|
||||
os.makedirs(models_dirs[0])
|
||||
|
||||
models["options"][model_type] = []
|
||||
default_tree = models["options"].get(model_type, [])
|
||||
|
||||
for model_dir in models_dirs:
|
||||
try:
|
||||
scanned_models = scan_directory(
|
||||
default_tree = models["options"].get(model_type, [])
|
||||
models["options"][model_type] = scan_directory(
|
||||
model_dir, model_extensions, default_entries=default_tree, nameFilter=nameFilter
|
||||
)
|
||||
for m in scanned_models:
|
||||
if m not in models["options"][model_type]:
|
||||
models["options"][model_type].append(m)
|
||||
except MaliciousModelException as e:
|
||||
models["scan-error"] = str(e)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user