Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PiSSA, OLoRA: Delete initial adapter after conversion instead of the active adapter #1933

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make style
  • Loading branch information
BenjaminBossan committed Jul 17, 2024
commit 7f50fd813efe8b15a1bf2c4fafcc9838f215665f
4 changes: 3 additions & 1 deletion src/peft/peft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ def save_mutated_as_lora(peft_config, path_initial_model_for_weight_conversion,
"The `init_lora_weights` parameter of the initial adapter should be set to `True`. "
"Otherwise, `self.load_adapter` will subtract the decomposed values again based on the residual model."
)
output_state_dict = self.base_model.subtract_mutated_init(output_state_dict, initial_adapter_name, kwargs)
output_state_dict = self.base_model.subtract_mutated_init(
output_state_dict, initial_adapter_name, kwargs
)
finally:
self.delete_adapter(initial_adapter_name)
return output_state_dict
Expand Down