sort lora list alphabetically

This commit is contained in:
Lincoln Stein
2023-04-03 16:19:30 -04:00
parent 667dee7b22
commit 793488e90a
3 changed files with 605 additions and 2 deletions

View File

@@ -535,7 +535,7 @@ class InvokeAIWebServer:
loras = loras + models
found_loras = []
for lora in loras:
for lora in sorted(loras):
location = str(lora.resolve()).replace("\\", "/")
found_loras.append({"name": lora.stem, "location": location})
socketio.emit("foundLoras", found_loras)

File diff suppressed because one or more lines are too long

View File

@@ -26,7 +26,7 @@ class LoRALayer:
def __init__(self, lora_name: str, name: str, rank=4, alpha=1.0):
self.lora_name = lora_name
self.name = name
self.scale = alpha / rank if alpha else 1.0
self.scale = alpha / rank if (alpha and rank) else 1.0
class LoRAModuleWrapper: