aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-06-09 13:26:36 +0300
committerAarni Koskela <akx@iki.fi>2023-06-09 13:26:36 +0300
commitd75ed52bfc07746c28ecd3bc35d76c2a6e1ce6ea (patch)
treeaca6ed8fe731f5ac248ee4a456c00ae61e22cf7c
parentcf28aed1a71ad8d9da5c6b44e0196c0629a4b246 (diff)
Don't die when a LoRA is a broken symlink
Fixes #11098
-rw-r--r--extensions-builtin/Lora/lora.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py
index af93991c..34ff57dd 100644
--- a/extensions-builtin/Lora/lora.py
+++ b/extensions-builtin/Lora/lora.py
@@ -448,7 +448,11 @@ def list_available_loras():
continue
name = os.path.splitext(os.path.basename(filename))[0]
- entry = LoraOnDisk(name, filename)
+ try:
+ entry = LoraOnDisk(name, filename)
+ except OSError: # should catch FileNotFoundError and PermissionError etc.
+ errors.report(f"Failed to load LoRA {name} from {filename}", exc_info=True)
+ continue
available_loras[name] = entry