Don't die when a LoRA is a broken symlink

Fixes #11098
This commit is contained in:
Aarni Koskela 2023-06-09 13:26:36 +03:00
parent cf28aed1a7
commit d75ed52bfc
1 changed files with 5 additions and 1 deletions

View File

@ -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