aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-09 22:31:49 +0300
committerGitHub <noreply@github.com>2023-06-09 22:31:49 +0300
commitb8d7506ebe8c27119b5cc105f9d518b35028a0f3 (patch)
tree632ca2fa3621eda23a5b0e1d078c4cbe669e7d55
parentf9606b8826cb3e0467312c317c4a7b504e2bb6a2 (diff)
parentd75ed52bfc07746c28ecd3bc35d76c2a6e1ce6ea (diff)
Merge pull request #11123 from akx/dont-die-on-bad-symlink-lora
Don't die when a LoRA is a broken symlink
-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