From d7385a6be534aafc60c9b6960ac351c87fd9d38c Mon Sep 17 00:00:00 2001 From: jiashunran Date: Thu, 9 Feb 2023 19:58:02 +0800 Subject: [PATCH] fix "local variable 'unet_path' referenced before assignment" in patch_pipe --- lora_diffusion/lora.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lora_diffusion/lora.py b/lora_diffusion/lora.py index 0b6d0e5..8753f15 100644 --- a/lora_diffusion/lora.py +++ b/lora_diffusion/lora.py @@ -974,6 +974,8 @@ def patch_pipe( unet_path = maybe_unet_path[:-6] + ".pt" elif maybe_unet_path.endswith(".text_encoder.pt"): unet_path = maybe_unet_path[:-16] + ".pt" + else: + unet_path = maybe_unet_path ti_path = _ti_lora_path(unet_path) text_path = _text_lora_path(unet_path)