mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-20 22:13:43 +00:00
Don't import PEFT unless necessary
This commit is contained in:
parent
c5b40eb555
commit
bba5b36d33
2 changed files with 13 additions and 9 deletions
|
|
@ -1,7 +1,6 @@
|
|||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
from peft import PeftModel
|
||||
from transformers import is_torch_xpu_available
|
||||
|
||||
import modules.shared as shared
|
||||
|
|
@ -85,6 +84,9 @@ def add_lora_autogptq(lora_names):
|
|||
|
||||
|
||||
def add_lora_transformers(lora_names):
|
||||
|
||||
from peft import PeftModel
|
||||
|
||||
prior_set = set(shared.lora_names)
|
||||
added_set = set(lora_names) - prior_set
|
||||
removed_set = prior_set - set(lora_names)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue