Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,6 @@ def choice_group_a(group_model_choice):
|
|
49 |
for m in models_test:
|
50 |
if group_model_choice==m[1]:
|
51 |
choice=m
|
52 |
-
print(choice)
|
53 |
return choice
|
54 |
|
55 |
def choice_group_b(choice):
|
@@ -58,14 +57,12 @@ def choice_group_b(choice):
|
|
58 |
def choice_group_c(choice):
|
59 |
return [gr.Textbox(m, visible=False) for m in choice]
|
60 |
|
61 |
-
def choice_groupe_d(
|
62 |
-
|
63 |
-
current_models=choice_group_c(choice)
|
64 |
-
output=choice_group_b(choice)
|
65 |
for m, o in zip(current_models, output):
|
66 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
67 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
68 |
-
return
|
69 |
|
70 |
def def_test(var_Test):
|
71 |
(gen_button,stop_button,group_model_choice)=var_Test
|
@@ -101,7 +98,7 @@ def make_me():
|
|
101 |
with gr.Row():
|
102 |
"""output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
103 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
|
104 |
-
|
105 |
choices=models_test[0]
|
106 |
output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
|
107 |
current_models = [gr.Textbox(m, visible=False) for m in choices]
|
@@ -119,10 +116,10 @@ def make_me():
|
|
119 |
"""
|
120 |
with gr.Accordion("test", open=True):
|
121 |
group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
|
122 |
-
|
123 |
-
group_model_choice.change(
|
124 |
-
group_model_choice.change(
|
125 |
-
group_model_choice.change(
|
126 |
with gr.Row():
|
127 |
gr.HTML("""
|
128 |
<div class="footer">
|
|
|
49 |
for m in models_test:
|
50 |
if group_model_choice==m[1]:
|
51 |
choice=m
|
|
|
52 |
return choice
|
53 |
|
54 |
def choice_group_b(choice):
|
|
|
57 |
def choice_group_c(choice):
|
58 |
return [gr.Textbox(m, visible=False) for m in choice]
|
59 |
|
60 |
+
def choice_groupe_d(var_Test):
|
61 |
+
(gen_button,stop_button,output,current_models)=var_Test
|
|
|
|
|
62 |
for m, o in zip(current_models, output):
|
63 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
64 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
65 |
+
return True
|
66 |
|
67 |
def def_test(var_Test):
|
68 |
(gen_button,stop_button,group_model_choice)=var_Test
|
|
|
98 |
with gr.Row():
|
99 |
"""output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
100 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
|
101 |
+
choice_test=True
|
102 |
choices=models_test[0]
|
103 |
output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
|
104 |
current_models = [gr.Textbox(m, visible=False) for m in choices]
|
|
|
116 |
"""
|
117 |
with gr.Accordion("test", open=True):
|
118 |
group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
|
119 |
+
group_model_choice.change(choice_group_a,group_model_choice,choices)
|
120 |
+
group_model_choice.change(choice_group_b,choices,output)
|
121 |
+
group_model_choice.change(choice_group_c,choices,current_models)
|
122 |
+
group_model_choice.change(choice_group_d,(gen_button,stop_button,output,current_models),choice_test)
|
123 |
with gr.Row():
|
124 |
gr.HTML("""
|
125 |
<div class="footer">
|