oobabooga vor 2 Jahren
Ursprung
Commit
a21e580782
1 geänderte Dateien mit 1 neuen und 2 gelöschten Zeilen
  1. 1 2
      modules/LoRA.py

+ 1 - 2
modules/LoRA.py

@@ -1,6 +1,7 @@
 from pathlib import Path
 from pathlib import Path
 
 
 import torch
 import torch
+from peft import PeftModel
 
 
 import modules.shared as shared
 import modules.shared as shared
 from modules.models import load_model
 from modules.models import load_model
@@ -14,8 +15,6 @@ def reload_model():
 
 
 def add_lora_to_model(lora_name):
 def add_lora_to_model(lora_name):
 
 
-    from peft import PeftModel
-
     # If a LoRA had been previously loaded, or if we want
     # If a LoRA had been previously loaded, or if we want
     # to unload a LoRA, reload the model
     # to unload a LoRA, reload the model
     if shared.lora_name not in ['None', ''] or lora_name in ['None', '']:
     if shared.lora_name not in ['None', ''] or lora_name in ['None', '']: