[SD3 dreambooth lora] smol fix to checkpoint saving#9993
Merged
linoytsaban merged 4 commits intohuggingface:mainfrom Nov 24, 2024
Merged
[SD3 dreambooth lora] smol fix to checkpoint saving#9993linoytsaban merged 4 commits intohuggingface:mainfrom
linoytsaban merged 4 commits intohuggingface:mainfrom
Conversation
|
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. |
sayakpaul
reviewed
Nov 24, 2024
Comment on lines
1297
to
1303
| elif isinstance(model, type(unwrap_model(text_encoder_one))): # or text_encoder_two | ||
| # check hidden size to distinguish between text_encoder_one and two | ||
| hidden_size = unwrap_model(model).config.hidden_size | ||
| if hidden_size == 768: | ||
| text_encoder_one_lora_layers_to_save = get_peft_model_state_dict(model) | ||
| elif hidden_size == 1280: | ||
| text_encoder_two_lora_layers_to_save = get_peft_model_state_dict(model) |
Member
There was a problem hiding this comment.
Works for me. We cannot distinguish with the classes here because both have the same class. Maybe this reasoning as a comment?
lawrence-cj
pushed a commit
to lawrence-cj/diffusers
that referenced
this pull request
Nov 26, 2024
* smol change to fix checkpoint saving & resuming (as done in train_dreambooth_sd3.py) * style * modify comment to explain reasoning behind hidden size check
sayakpaul
pushed a commit
that referenced
this pull request
Dec 23, 2024
* smol change to fix checkpoint saving & resuming (as done in train_dreambooth_sd3.py) * style * modify comment to explain reasoning behind hidden size check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minor change to fix saving of text-encoder layers in lora training script, as we have in place in the dreambooth training script.
related to #8955