Spaces:
Running
Running
feat: 更新复选框change事件处理程序以包含标签参数
Browse files
app.py
CHANGED
@@ -131,7 +131,7 @@ class Demo:
|
|
131 |
# 添加复选框的change事件处理程序
|
132 |
model_checkbox.change(
|
133 |
fn=self.update_model_sections,
|
134 |
-
inputs=[model_checkbox, seed_infr, slider_scale_infr],
|
135 |
outputs=[]
|
136 |
)
|
137 |
|
@@ -270,10 +270,10 @@ class Demo:
|
|
270 |
outputs=[self.train_button, self.train_status, self.download, self.model_dropdown]
|
271 |
)
|
272 |
|
273 |
-
def update_model_sections(self, checkbox, seed, scale):
|
274 |
for i, section in enumerate(self.model_sections):
|
275 |
-
if section[0][0] ==
|
276 |
-
self.model_sections[i] = ((
|
277 |
break
|
278 |
|
279 |
def train(self, target_concept,positive_prompt, negative_prompt, rank, iterations_input, lr_input, attributes_input, is_person, train_method_input, pbar = gr.Progress(track_tqdm=True)):
|
|
|
131 |
# 添加复选框的change事件处理程序
|
132 |
model_checkbox.change(
|
133 |
fn=self.update_model_sections,
|
134 |
+
inputs=[model_checkbox.label, model_checkbox, seed_infr, slider_scale_infr],
|
135 |
outputs=[]
|
136 |
)
|
137 |
|
|
|
270 |
outputs=[self.train_button, self.train_status, self.download, self.model_dropdown]
|
271 |
)
|
272 |
|
273 |
+
def update_model_sections(self, label, checkbox, seed, scale):
|
274 |
for i, section in enumerate(self.model_sections):
|
275 |
+
if section[0][0] == label:
|
276 |
+
self.model_sections[i] = ((label, checkbox), seed, scale)
|
277 |
break
|
278 |
|
279 |
def train(self, target_concept,positive_prompt, negative_prompt, rank, iterations_input, lr_input, attributes_input, is_person, train_method_input, pbar = gr.Progress(track_tqdm=True)):
|