Skip to content

[dreambooth] allow fine-tuning text encoder - #883

Merged
patil-suraj merged 3 commits into
mainfrom
dreambooth-train-text-encoder
Oct 18, 2022
Merged

patil-suraj merged 3 commits into
mainfrom
dreambooth-train-text-encoder

Conversation

@patil-suraj

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

Copy link
Copy Markdown
Contributor

Co-authored-by: @shirayu

Allow fine-tuning text encoder in dreambooth.

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Oct 17, 2022 •

Copy link
Copy Markdown

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

@anton-l anton-l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@patrickvonplaten

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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.

6 participants