From 1127fb05405659884ecf2b1991ddd7b4c0a22131 Mon Sep 17 00:00:00 2001 From: dt990pro Date: Fri, 21 Apr 2023 06:42:47 +0100 Subject: [PATCH 1/2] add cfg to train inverse with autocast --- lora_diffusion/cli_lora_pti.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lora_diffusion/cli_lora_pti.py b/lora_diffusion/cli_lora_pti.py index 7de4bae..1ab749e 100644 --- a/lora_diffusion/cli_lora_pti.py +++ b/lora_diffusion/cli_lora_pti.py @@ -740,6 +740,7 @@ def train( weight_decay_ti: float = 0.00, weight_decay_lora: float = 0.001, use_8bit_adam: bool = False, + autocast_train_inversion: bool = False, device="cuda:0", extra_args: Optional[dict] = None, log_wandb: bool = False, @@ -924,7 +925,7 @@ def train( wandb_log_prompt_cnt=wandb_log_prompt_cnt, class_token=class_token, train_inpainting=train_inpainting, - mixed_precision=False, + mixed_precision=autocast_train_inversion, tokenizer=tokenizer, clip_ti_decay=clip_ti_decay, ) From 9ddf60b8ca8e22c733b44aec367310233cc5605a Mon Sep 17 00:00:00 2001 From: Jiawei Mok Date: Fri, 21 Apr 2023 15:43:16 +0800 Subject: [PATCH 2/2] use_autocast_train_inversion --- lora_diffusion/cli_lora_pti.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lora_diffusion/cli_lora_pti.py b/lora_diffusion/cli_lora_pti.py index 1ab749e..417dc97 100644 --- a/lora_diffusion/cli_lora_pti.py +++ b/lora_diffusion/cli_lora_pti.py @@ -740,7 +740,7 @@ def train( weight_decay_ti: float = 0.00, weight_decay_lora: float = 0.001, use_8bit_adam: bool = False, - autocast_train_inversion: bool = False, + use_autocast_train_inversion: bool = False, device="cuda:0", extra_args: Optional[dict] = None, log_wandb: bool = False, @@ -925,7 +925,7 @@ def train( wandb_log_prompt_cnt=wandb_log_prompt_cnt, class_token=class_token, train_inpainting=train_inpainting, - mixed_precision=autocast_train_inversion, + mixed_precision=use_autocast_train_inversion, tokenizer=tokenizer, clip_ti_decay=clip_ti_decay, )