From 4f6ecc2fd38dc894ac7fcb4f130d3ab8af49d132 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 25 Jun 2023 08:40:05 +0200 Subject: Update --- training/strategy/dreambooth.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'training/strategy/dreambooth.py') diff --git a/training/strategy/dreambooth.py b/training/strategy/dreambooth.py index 3d1abf7..7e67589 100644 --- a/training/strategy/dreambooth.py +++ b/training/strategy/dreambooth.py @@ -154,6 +154,9 @@ def dreambooth_strategy_callbacks( unet_ = accelerator.unwrap_model(unet, keep_fp32_wrapper=False) text_encoder_ = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=False) + text_encoder_.forward = MethodType(text_encoder_.forward, text_encoder_) + unet_.forward = MethodType(unet_.forward, unet_) + text_encoder_.text_model.embeddings.persist(False) with ema_context(): -- cgit v1.2.3-54-g00ecf