Unverified Commit 3b5b1c56 authored by Vinh H. Pham's avatar Vinh H. Pham Committed by GitHub
Browse files

[Fix] train_dreambooth_lora_flux_advanced ValueError: unexpected save model:...

[Fix] train_dreambooth_lora_flux_advanced ValueError: unexpected save model: <class 'transformers.models.t5.modeling_t5.T5EncoderModel'> (#9777)

fix save state te T5
parent fddbab79
...@@ -1650,6 +1650,8 @@ def main(args): ...@@ -1650,6 +1650,8 @@ def main(args):
elif isinstance(model, type(unwrap_model(text_encoder_one))): elif isinstance(model, type(unwrap_model(text_encoder_one))):
if args.train_text_encoder: # when --train_text_encoder_ti we don't save the layers if args.train_text_encoder: # when --train_text_encoder_ti we don't save the layers
text_encoder_one_lora_layers_to_save = get_peft_model_state_dict(model) text_encoder_one_lora_layers_to_save = get_peft_model_state_dict(model)
elif isinstance(model, type(unwrap_model(text_encoder_two))):
pass # when --train_text_encoder_ti and --enable_t5_ti we don't save the layers
else: else:
raise ValueError(f"unexpected save model: {model.__class__}") raise ValueError(f"unexpected save model: {model.__class__}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment