Load more than one LoRA with --lora, fix a bug

This commit is contained in:
oobabooga 2023-04-25 22:58:48 -03:00
parent 15940e762e
commit f39c99fa14
4 changed files with 4 additions and 4 deletions

View file

@ -7,10 +7,10 @@ import modules.shared as shared
def add_lora_to_model(lora_names):
shared.lora_names = list(lora_names)
prior_set = set(shared.lora_names)
added_set = set(lora_names) - prior_set
removed_set = prior_set - set(lora_names)
shared.lora_names = list(lora_names)
# If no LoRA needs to be added or removed, exit
if len(added_set) == 0 and len(removed_set) == 0: