Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -74,21 +74,40 @@ def infer(lora_1_id, lora_1_sfts, lora_2_id, lora_2_sfts, prompt, negative_promp
|
|
74 |
|
75 |
pipe.to("cuda")
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
pipe.fuse_lora(lora_1_scale)
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
pipe.fuse_lora(lora_2_scale)
|
94 |
|
|
|
74 |
|
75 |
pipe.to("cuda")
|
76 |
|
77 |
+
if lora_1_sfts == "NO SAFETENSORS FILE":
|
78 |
+
pipe.load_lora_weights(
|
79 |
+
lora_1_id,
|
80 |
+
low_cpu_mem_usage = True,
|
81 |
+
use_auth_token = True
|
82 |
+
)
|
83 |
+
|
84 |
+
else:
|
85 |
+
pipe.load_lora_weights(
|
86 |
+
lora_1_id,
|
87 |
+
weight_name = lora_1_sfts,
|
88 |
+
low_cpu_mem_usage = True,
|
89 |
+
use_auth_token = True
|
90 |
+
)
|
91 |
+
|
92 |
+
|
93 |
|
94 |
pipe.fuse_lora(lora_1_scale)
|
95 |
|
96 |
+
if lora_2_sfts == "NO SAFETENSORS FILE":
|
97 |
+
pipe.load_lora_weights(
|
98 |
+
lora_2_id,
|
99 |
+
low_cpu_mem_usage = True,
|
100 |
+
use_auth_token = True
|
101 |
+
)
|
102 |
+
|
103 |
+
else:
|
104 |
+
pipe.load_lora_weights(
|
105 |
+
lora_2_id,
|
106 |
+
weight_name = lora_2_sfts,
|
107 |
+
low_cpu_mem_usage = True,
|
108 |
+
use_auth_token = True
|
109 |
+
)
|
110 |
+
|
111 |
|
112 |
pipe.fuse_lora(lora_2_scale)
|
113 |
|