Skip to content

Commit 3b5b1c5

Browse files
authored
[Fix] train_dreambooth_lora_flux_advanced ValueError: unexpected save model: <class 'transformers.models.t5.modeling_t5.T5EncoderModel'> (#9777)
fix save state te T5
1 parent fddbab7 commit 3b5b1c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,8 @@ def save_model_hook(models, weights, output_dir):
16501650
elif isinstance(model, type(unwrap_model(text_encoder_one))):
16511651
if args.train_text_encoder: # when --train_text_encoder_ti we don't save the layers
16521652
text_encoder_one_lora_layers_to_save = get_peft_model_state_dict(model)
1653+
elif isinstance(model, type(unwrap_model(text_encoder_two))):
1654+
pass # when --train_text_encoder_ti and --enable_t5_ti we don't save the layers
16531655
else:
16541656
raise ValueError(f"unexpected save model: {model.__class__}")
16551657

0 commit comments

Comments
 (0)