From a36a87258eb28278d493cdec160c6fdfabd17f49 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Tue, 30 Jul 2024 19:04:24 +0900 Subject: [PATCH] put lr into kwargs instead --- src/peft/optimizers/loraplus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/peft/optimizers/loraplus.py b/src/peft/optimizers/loraplus.py index 3278d87fba..21d334a75c 100644 --- a/src/peft/optimizers/loraplus.py +++ b/src/peft/optimizers/loraplus.py @@ -30,7 +30,7 @@ def create_loraplus_optimizer( - model: PeftModel, optimizer_cls: type[Optimizer], *, loraplus_lr_ratio: float, **kwargs + model: PeftModel, optimizer_cls: type[Optimizer], *, lr: float, loraplus_lr_ratio: float, **kwargs ) -> Optimizer: """ Creates a LoraPlus optimizer. @@ -81,7 +81,7 @@ def create_loraplus_optimizer( else: param_groups["groupA"][name] = param - lr = kwargs["lr"] + kwargs["lr"] = lr loraplus_weight_decay = kwargs.pop("loraplus_weight_decay", 0.0) loraplus_lr_embedding = kwargs.pop("loraplus_lr_embedding", 1e-6)