瀏覽代碼

Move an import

oobabooga 2 年之前
父節點
當前提交
a21e580782
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      modules/LoRA.py

+ 1 - 2
modules/LoRA.py

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