Merge pull request #11123 from akx/dont-die-on-bad-symlink-lora

Don't die when a LoRA is a broken symlink
This commit is contained in:
AUTOMATIC1111 2023-06-09 22:31:49 +03:00 committed by GitHub
commit b8d7506ebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -448,7 +448,11 @@ def list_available_loras():
continue continue
name = os.path.splitext(os.path.basename(filename))[0] 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 available_loras[name] = entry