Update LoRA.py

This commit is contained in:
oobabooga 2023-03-23 22:02:09 -03:00 committed by GitHub
parent bf22d16ebc
commit b0abb327d8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,11 @@ def add_lora_to_model(lora_name):
from peft import PeftModel
reload_model()
# If a LoRA had been previously loaded, or if we want
# to unload a LoRA, reload the model
if shared.lora_name != "None" or lora_name == "None":
reload_model()
shared.lora_name = lora_name
if lora_name != "None":
print(f"Adding the LoRA {lora_name} to the model...")