Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/token_classification/peft_lora_token_cls.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@
{
"data": {
"text/plain": [
"LoRAConfig(pet_type='LORA', task_type='TOKEN_CLS', inference_mode=False, r=16, target_modules=None, lora_alpha=16, lora_dropout=0.1, merge_weights=False, fan_in_fan_out=False, enable_lora=None, bias='all')"
"LoRAConfig(pet_type='LORA', task_type='TOKEN_CLS', inference_mode=False, r=16, target_modules=None, lora_alpha=16, lora_dropout=0.1, fan_in_fan_out=False, enable_lora=None, bias='all')"
]
},
"execution_count": 13,
Expand Down
1 change: 0 additions & 1 deletion src/peft/peft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,6 @@ class PeftModelForSeq2SeqLM(PeftModel):
... "target_modules": ["q", "v"],
... "lora_alpha": 32,
... "lora_dropout": 0.1,
... "merge_weights": False,
... "fan_in_fan_out": False,
... "enable_lora": None,
... "bias": "none",
Expand Down
2 changes: 0 additions & 2 deletions src/peft/tuners/adalora.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ def _prepare_adalora_config(peft_config, model_config):
peft_config.target_modules = TRANSFORMERS_MODELS_TO_ADALORA_TARGET_MODULES_MAPPING[
model_config["model_type"]
]
if peft_config.inference_mode:
peft_config.merge_weights = True
return peft_config


Expand Down
2 changes: 0 additions & 2 deletions src/peft/tuners/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ def _prepare_lora_config(peft_config, model_config):
if model_config["model_type"] not in TRANSFORMERS_MODELS_TO_LORA_TARGET_MODULES_MAPPING:
raise ValueError("Please specify `target_modules` in `peft_config`")
peft_config.target_modules = TRANSFORMERS_MODELS_TO_LORA_TARGET_MODULES_MAPPING[model_config["model_type"]]
if peft_config.inference_mode:
peft_config.merge_weights = True
return peft_config

def merge_and_unload(self):
Expand Down