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

[Fix] remove setting lr for T5 text encoder when using prodigy in flux dreambooth lora script #9473

Merged
merged 7 commits into from
Oct 28, 2024

Conversation

biswaroop1547
Copy link
Contributor

What does this PR do?

Fixes #9464
Partially Fixes #9393 (comment)

Before submitting

Who can review?

cc @sayakpaul @linoytsaban

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@yiyixuxu yiyixuxu requested a review from sayakpaul September 19, 2024 22:44
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@@ -1372,7 +1372,6 @@ def load_model_hook(models, input_dir):
# changes the learning rate of text_encoder_parameters_one and text_encoder_parameters_two to be
# --learning_rate
params_to_optimize[1]["lr"] = args.learning_rate
params_to_optimize[2]["lr"] = args.learning_rate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is the right fix because what happens when we train the text encoder, too? Cc @linoytsaban

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we enable the option for training text encoders too, we only target the clip model and not the T5 for flux, hence this line was unnecessary from what I noticed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hence also the reason for the indexerror^

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed for now we support full fine-tuning of the CLIP encoder only when --train_text_encoder is enabled, so simply removing this line for now should be good!

@linoytsaban
Copy link
Collaborator

should be good to merge I believe, are we awaiting further changes? @sayakpaul

@sayakpaul
Copy link
Member

@linoytsaban feel free to merge once the CI is green.

Copy link

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.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Oct 26, 2024
@sayakpaul
Copy link
Member

@linoytsaban okay to merge?

@github-actions github-actions bot removed the stale Issues that haven't received updates label Oct 27, 2024
@linoytsaban
Copy link
Collaborator

@sayakpaul ok to merge, it's just the test that's failing for some reason

@linoytsaban linoytsaban merged commit 493aa74 into huggingface:main Oct 28, 2024
8 checks passed
sayakpaul added a commit that referenced this pull request Dec 23, 2024
…x dreambooth lora script (#9473)

* fix: removed setting of text encoder lr for T5 as it's not being tuned

* fix: removed setting of text encoder lr for T5 as it's not being tuned

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants