diff --git a/paddlenlp/peft/lora/lora_model.py b/paddlenlp/peft/lora/lora_model.py index 0bfa61364ece..74d8220e25ce 100644 --- a/paddlenlp/peft/lora/lora_model.py +++ b/paddlenlp/peft/lora/lora_model.py @@ -334,18 +334,18 @@ def process_split_and_assign(name, concat_tensor, axis, init_dict, state_dict): final_lora, init_lora = paddle.split(concat_tensor, 2, axis=axis) init_dict[name] = init_lora state_dict[name] = final_lora - return final_lora, init_lora + return init_lora for name in state_dict.keys(): if "lora_A" in name: concat_lora_A = state_dict[name] - final_loraA, init_loraA = process_split_and_assign( + init_loraA = process_split_and_assign( name, concat_lora_A, axis=1, init_dict=self.loraga_init_dict, state_dict=state_dict ) loraB_name = name.replace("lora_A", "lora_B") concat_lora_B = state_dict[loraB_name] - final_loraB, init_loraB = process_split_and_assign( + init_loraB = process_split_and_assign( loraB_name, concat_lora_B, axis=0, init_dict=self.loraga_init_dict, state_dict=state_dict ) diff --git a/paddlenlp/peft/lora/loraga_utils.py b/paddlenlp/peft/lora/loraga_utils.py index 5c821772ea32..7400e2e3b88d 100644 --- a/paddlenlp/peft/lora/loraga_utils.py +++ b/paddlenlp/peft/lora/loraga_utils.py @@ -76,7 +76,7 @@ def estimate_gradient(self, model: PretrainedModel): iters += 1 # Pipeline parallel not supported currently with paddle.amp.auto_cast(enable=True, custom_black_list=self.args.amp_custom_black_list): - loss, logits = model(**batch) + loss, _ = model(**batch) loss.backward() if iters == self.loraga_init_iters: