mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 01:30:20 +01:00
Update LoRA.py - avoid potential error (#2953)
This commit is contained in:
parent
33f56fd41d
commit
c23c88ee4c
@ -106,8 +106,10 @@ def add_lora_transformers(lora_names):
|
|||||||
|
|
||||||
# If any LoRA needs to be removed, start over
|
# If any LoRA needs to be removed, start over
|
||||||
if len(removed_set) > 0:
|
if len(removed_set) > 0:
|
||||||
shared.model.disable_adapter()
|
# shared.model may no longer be PeftModel
|
||||||
shared.model = shared.model.base_model.model
|
if hasattr(shared.model, 'disable_adapter'):
|
||||||
|
shared.model.disable_adapter()
|
||||||
|
shared.model = shared.model.base_model.model
|
||||||
|
|
||||||
if len(lora_names) > 0:
|
if len(lora_names) > 0:
|
||||||
params = {}
|
params = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user