-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Is it possible to "unload" the PEFT LoRA weights after mutating the base model with PeftModel.from_pretrained ? #208
Comments
You may try Disclaimer: I am new to this lib, just based on reading the code. |
@pacman100 Does the PR allow one to swap LoRA adapters as well ? I would like to be able to load and keep a single base model in memory and swap between several LoRA trained adapters on-the-fly. (GPT2 if that matters) I tested the main branch as of a few days ago and I wasn't able to. Had some error when trying to load another adapter after using |
Hello @accountForIssues, I'm currently working on it, will ping here when the PR is ready |
Very awaited feature! |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. |
This is now fixed in the multi adapter loading! Closing. |
Hi, @lxe. I'm new to peft. The model.merge_and_unload() method looks like magic to me. Could you give a quick introduction about model.merge_and_unload()? In my view, LoRA adds new trainable parameters/layers and inserts these layers into the base model, that is the LoRA model has additional structures on top of the base model. And we can save the merge_and_unload model and reload it with base_model.from_pretrained(unloaded_model_path) interface. But where are the additional layers and parameters? |
Is it possible to "unload" the PEFT LoRA weights after mutating the base model with PeftModel.from_pretrained?
I'd like to load multiple LoRA models on top of a base model, and unloading the whole base model every time is time consuming. Was wondering if there's a way to un-load the PEFT model and have the base model remain in memory.
The text was updated successfully, but these errors were encountered: