fffiloni commited on
Commit
c401eef
·
1 Parent(s): 05510a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -12
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
- pipe.load_lora_weights(
78
- lora_1_id,
79
- weight_name = lora_1_sfts,
80
- low_cpu_mem_usage = True,
81
- use_auth_token = True
82
- )
 
 
 
 
 
 
 
 
 
 
83
 
84
  pipe.fuse_lora(lora_1_scale)
85
 
86
- pipe.load_lora_weights(
87
- lora_2_id,
88
- weight_name = lora_2_sfts,
89
- low_cpu_mem_usage = True,
90
- use_auth_token = True
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