Uh oh!
There was an error while loading. Please reload this page.
[PEFT] Adapt example scripts to use PEFT - #5388
Conversation
Uh oh!
There was an error while loading. Please reload this page.
HuggingFaceDocBuilderDev
commented
Oct 13, 2023
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sayakpaul
commented
Oct 15, 2023
Left some comments. Thanks for initiating this! |
patrickvonplaten
commented
Oct 16, 2023
Before doing this change it would be good to have both a PEFT and a Transformers release to not force the user to install these packages from main |
younesbelkada
commented
Oct 16, 2023
OK I will push the changes for SDXL and wait until the next release of PEFT before merging this PR |
younesbelkada
commented
Oct 23, 2023
I can confirm the scripts work fine under peft + diffusers main! I'll mark the PR as ready for review once do a release on PEFT |
younesbelkada
commented
Nov 14, 2023
This PR is ready for review! Let me know if you want me to work on saving adapter configs here, otherwise i can do it as a follow up PR. Please also see the attached wandb logs in the PR description above |
Uh oh!
There was an error while loading. Please reload this page.
sayakpaul
commented
Nov 29, 2023
@patrickvonplaten this should be more or less ready to be merged, especially with huggingface/peft#1189. @BenjaminBossan if would like to review the Here's my Colab Notebook: https://colab.research.google.com/gist/sayakpaul/e112cc40288c5f0563efa4034dd50b72/scratchpad.ipynb. |
| unet_lora_config = LoraConfig( | ||
| r=args.rank, | ||
| init_lora_weights="gaussian", | ||
| target_modules=["to_k", "to_q", "to_v", "to_out.0", "add_k_proj", "add_v_proj"], |
There was a problem hiding this comment.
@younesbelkada in your previous iterations, we were missing "to_out.0" in the target_module for some scripts. I have added that.
BenjaminBossan
commented
Nov 29, 2023
From the PEFT-side of things, this looks pretty good, thanks Sayak. Just a consideration: Right now, the requirements include a source install of PEFT. This works for the moment but could be dangerous in the future, in case we add something to PEFT |
sayakpaul
commented
Nov 29, 2023
@BenjaminBossan good point. Could you get me the required hash here? I will resolve ASAP. |
patrickvonplaten
commented
Nov 29, 2023
I'd like to wait a bit until PEFT has done a release to make it easier for users (think it doesn't hurt us to wait a tad more here no?) Does the training now match more or less (e.g. is the new init used?). |
BenjaminBossan
commented
Nov 29, 2023
Latest hash is
|
sayakpaul
commented
Nov 29, 2023
@patrickvonplaten yes it does. Have verified it. This PR uses the new init method from peft too. I don't mind waiting either. |
younesbelkada
commented
Dec 6, 2023
PEFT 0.7.0 has been released ! https://github.com/huggingface/peft/releases/tag/v0.7.0 |
patrickvonplaten
left a comment
There was a problem hiding this comment.
Ok for me to add once @sayakpaul gives the green light
* adapt example scripts to use PEFT * Update examples/text_to_image/train_text_to_image_lora.py * fix * add for SDXL * oops * make sure to install peft * fix * fix * fix dreambooth and lora * more fixes * add peft to requirements.txt * fix * final fix * add peft version in requirements * remove comment * change variable names * add few lines in readme * add to reqs * style * fix issues * fix lora dreambooth xl tests * init_lora_weights to gaussian and add out proj where missing * ammend requirements. * ammend requirements.txt * add correct peft versions --------- Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* adapt example scripts to use PEFT * Update examples/text_to_image/train_text_to_image_lora.py * fix * add for SDXL * oops * make sure to install peft * fix * fix * fix dreambooth and lora * more fixes * add peft to requirements.txt * fix * final fix * add peft version in requirements * remove comment * change variable names * add few lines in readme * add to reqs * style * fix issues * fix lora dreambooth xl tests * init_lora_weights to gaussian and add out proj where missing * ammend requirements. * ammend requirements.txt * add correct peft versions --------- Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
What does this PR do?
Fixes: #5341
Wandb logs: https://wandb.ai/younesbelkada/text2image-fine-tune/runs/tj5k8xtm?workspace=user-younesbelkada
I have fine-tuned it on Pokemon blip captions and the model trained after 1200 steps can be found here: https://huggingface.co/ybelkada/sd-1.5-pokemon-lora-peft
cc @sayakpaul@patrickvonplaten
TODO: