Skip to content

Conversation

@patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Oct 17, 2022

Co-authored-by: @shirayu

Allow fine-tuning text encoder in dreambooth.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 17, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@anton-l anton-l left a comment

Choose a reason for hiding this comment

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

LGTM!

@patrickvonplaten
Copy link
Contributor

Cool!

args.pretrained_model_name_or_path, unet=accelerator.unwrap_model(unet)
args.pretrained_model_name_or_path,
unet=accelerator.unwrap_model(unet),
text_encoder=accelerator.unwrap_model(text_encoder),
Copy link
Member

Choose a reason for hiding this comment

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

This is not true when not finetuning the text encoder, is it?

Suggested change
text_encoder=accelerator.unwrap_model(text_encoder),
text_encoder=accelerator.unwrap_model(text_encoder) if args.train_text_encoder else text_encoder,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in that case accelerator.unwrap_model will act as a no op, so it's fine to use it like this.

@patrickvonplaten
Copy link
Contributor

BTW not necessary in this PR, but it'd be very nice if we could update this table here: https://github.com/huggingface/diffusers/tree/main/examples#-diffusers-examples -> it's always nice to see directly all the examples at once.

@patil-suraj patil-suraj merged commit fbe807b into main Oct 18, 2022
@patil-suraj patil-suraj deleted the dreambooth-train-text-encoder branch October 18, 2022 15:28
@DonStroganotti
Copy link

I guess this isn't compatible with deepspeed and a 8 GB GPU?

kumquatexpress pushed a commit to harvestlabs/diffusers that referenced this pull request Oct 19, 2022
* allow fine-tuning text encoder

* fix a few things

* update readme
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* allow fine-tuning text encoder

* fix a few things

* update readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants