Spaces:
Sleeping
Sleeping
исправляем ошибку устанорвки lora_scale - меняем на параметр "cross_attention_kwargs"
Browse files- app_old.py → app.py +4 -1
app_old.py → app.py
RENAMED
@@ -102,7 +102,9 @@ def infer(
|
|
102 |
pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
|
103 |
#pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)
|
104 |
|
105 |
-
|
|
|
|
|
106 |
#pipe.text_encoder.load_state_dict({k: lora_scale*v for k, v in pipe.text_encoder.state_dict().items()})
|
107 |
|
108 |
if torch_dtype in (torch.float16, torch.bfloat16):
|
@@ -120,6 +122,7 @@ def infer(
|
|
120 |
|
121 |
examples = [
|
122 |
"Puss in Boots wearing a sombrero crosses the Grand Canyon on a tightrope with a guitar.",
|
|
|
123 |
"A cat is playing a song called ""About the Cat"" on an accordion by the sea at sunset. The sun is quickly setting behind the horizon, and the light is fading.",
|
124 |
"A cat walks through the grass on the streets of an abandoned city. The camera view is always focused on the cat's face.",
|
125 |
"A young lady in a Russian embroidered kaftan is sitting on a beautiful carved veranda, holding a cup to her mouth and drinking tea from the cup. With her other hand, the girl holds a saucer. The cup and saucer are painted with gzhel. Next to the girl on the table stands a samovar, and steam can be seen above it.",
|
|
|
102 |
pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
|
103 |
#pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)
|
104 |
|
105 |
+
# исправляем ошибку устанорвки lora_scale - меняем на параметр "cross_attention_kwargs"
|
106 |
+
# pipe.unet.load_state_dict({k: lora_scale*v for k, v in pipe.unet.state_dict().items()})
|
107 |
+
params['cross_attention_kwargs'] = {"scale": float(lora_scale)}
|
108 |
#pipe.text_encoder.load_state_dict({k: lora_scale*v for k, v in pipe.text_encoder.state_dict().items()})
|
109 |
|
110 |
if torch_dtype in (torch.float16, torch.bfloat16):
|
|
|
122 |
|
123 |
examples = [
|
124 |
"Puss in Boots wearing a sombrero crosses the Grand Canyon on a tightrope with a guitar.",
|
125 |
+
"Cat wearing a sombrero crosses the Grand Canyon on a tightrope with a guitar.",
|
126 |
"A cat is playing a song called ""About the Cat"" on an accordion by the sea at sunset. The sun is quickly setting behind the horizon, and the light is fading.",
|
127 |
"A cat walks through the grass on the streets of an abandoned city. The camera view is always focused on the cat's face.",
|
128 |
"A young lady in a Russian embroidered kaftan is sitting on a beautiful carved veranda, holding a cup to her mouth and drinking tea from the cup. With her other hand, the girl holds a saucer. The cup and saucer are painted with gzhel. Next to the girl on the table stands a samovar, and steam can be seen above it.",
|