Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,8 +46,8 @@ def infer(
|
|
46 |
pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
|
47 |
pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)
|
48 |
|
49 |
-
|
50 |
-
|
51 |
|
52 |
if torch_dtype in (torch.float16, torch.bfloat16):
|
53 |
pipe.unet.half()
|
|
|
46 |
pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
|
47 |
pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)
|
48 |
|
49 |
+
pipe.unet.load_state_dict({k: lora_scale*v for k, v in pipe.unet.state_dict().items()})
|
50 |
+
pipe.text_encoder.load_state_dict({k: lora_scale*v for k, v in pipe.text_encoder.state_dict().items()})
|
51 |
|
52 |
if torch_dtype in (torch.float16, torch.bfloat16):
|
53 |
pipe.unet.half()
|