Update app.py
Browse files
app.py
CHANGED
@@ -87,11 +87,24 @@ def make_me():
|
|
87 |
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button])
|
88 |
|
89 |
with gr.Row():
|
90 |
-
output = [
|
91 |
-
progress_bars = [
|
92 |
-
progress_labels = [
|
93 |
feedback_box = gr.Textbox(label="Feedback", lines=10, interactive=False, elem_id="custom_feedback_box")
|
94 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
for m, o, p, l, c in zip(current_models, output, progress_bars, progress_labels, default_models):
|
96 |
gen_event = gen_button.click(gen_fn, [m, txt_input, negative_txt_input, gr.Slider(1, 10, value=10, label="Max Retries"), p], [o, feedback_box], cancels=[gen_event])
|
97 |
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button], cancels=[gen_event])
|
|
|
87 |
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button])
|
88 |
|
89 |
with gr.Row():
|
90 |
+
output = []
|
91 |
+
progress_bars = []
|
92 |
+
progress_labels = []
|
93 |
feedback_box = gr.Textbox(label="Feedback", lines=10, interactive=False, elem_id="custom_feedback_box")
|
94 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
95 |
+
|
96 |
+
for m in default_models:
|
97 |
+
if m != 'NA':
|
98 |
+
progress_label = gr.Markdown(value=f"**Progress for {m}**")
|
99 |
+
progress_bar = gr.Progress()
|
100 |
+
output.append(gr.Image(label=m, min_width=250, height=250, elem_id="custom_image"))
|
101 |
+
progress_labels.append(progress_label)
|
102 |
+
progress_bars.append(progress_bar)
|
103 |
+
else:
|
104 |
+
output.append(gr.Image(label=m, visible=False, elem_id="custom_image"))
|
105 |
+
progress_labels.append(gr.Markdown(value="", visible=False))
|
106 |
+
progress_bars.append(gr.Progress(visible=False))
|
107 |
+
|
108 |
for m, o, p, l, c in zip(current_models, output, progress_bars, progress_labels, default_models):
|
109 |
gen_event = gen_button.click(gen_fn, [m, txt_input, negative_txt_input, gr.Slider(1, 10, value=10, label="Max Retries"), p], [o, feedback_box], cancels=[gen_event])
|
110 |
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button], cancels=[gen_event])
|