Update app.py
Browse files
app.py
CHANGED
@@ -40,6 +40,20 @@ def update_imgbox(choices):
|
|
40 |
choices_plus = extend_choices(choices)
|
41 |
return [gr.Image(None, label=m, visible=(m != 'NA')) for m in choices_plus]
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
def gen_fn(model_str, prompt):
|
44 |
if model_str == 'NA':
|
45 |
return None
|
@@ -78,19 +92,15 @@ def make_me():
|
|
78 |
with gr.Accordion("test", open=True):
|
79 |
group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=models_test , allow_custom_value=True)
|
80 |
group_model_choice.change(choice_group_a,group_model_choice,(model_choice,output,current_models))
|
|
|
|
|
81 |
with gr.Row():
|
82 |
gr.HTML("""
|
83 |
<div class="footer">
|
84 |
<p> Based on the <a href="https://huggingface.co/spaces/derwahnsinn/TestGen">TestGen</a> Space by derwahnsinn, the <a href="https://huggingface.co/spaces/RdnUser77/SpacIO_v1">SpacIO</a> Space by RdnUser77 and Omnibus's Maximum Multiplier!
|
85 |
</p>
|
86 |
""")
|
87 |
-
|
88 |
-
models=group_model_choice
|
89 |
-
load_fn(models)
|
90 |
-
model_choice = gr.CheckboxGroup(models, label=f' {num_models} different models selected', value=default_models, multiselect=True, max_choices=num_models, interactive=True, filterable=False)
|
91 |
-
output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
92 |
-
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
93 |
-
return (model_choice,output,current_models)
|
94 |
|
95 |
js_code = """
|
96 |
|
|
|
40 |
choices_plus = extend_choices(choices)
|
41 |
return [gr.Image(None, label=m, visible=(m != 'NA')) for m in choices_plus]
|
42 |
|
43 |
+
def choice_group_a(group_model_choice):
|
44 |
+
models=group_model_choice
|
45 |
+
load_fn(models)
|
46 |
+
model_choice = gr.CheckboxGroup(models, label=f' {num_models} different models selected', value=default_models, multiselect=True, max_choices=num_models, interactive=True, filterable=False)
|
47 |
+
return (model_choice,output,current_models)
|
48 |
+
|
49 |
+
def choice_group_b(group_model_choice):
|
50 |
+
output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
51 |
+
return output
|
52 |
+
|
53 |
+
def choice_group_c(group_model_choice):
|
54 |
+
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
55 |
+
return current_models
|
56 |
+
|
57 |
def gen_fn(model_str, prompt):
|
58 |
if model_str == 'NA':
|
59 |
return None
|
|
|
92 |
with gr.Accordion("test", open=True):
|
93 |
group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=models_test , allow_custom_value=True)
|
94 |
group_model_choice.change(choice_group_a,group_model_choice,(model_choice,output,current_models))
|
95 |
+
group_model_choice.change(choice_group_b,group_model_choice,output)
|
96 |
+
group_model_choice.change(choice_group_c,group_model_choice,current_models)
|
97 |
with gr.Row():
|
98 |
gr.HTML("""
|
99 |
<div class="footer">
|
100 |
<p> Based on the <a href="https://huggingface.co/spaces/derwahnsinn/TestGen">TestGen</a> Space by derwahnsinn, the <a href="https://huggingface.co/spaces/RdnUser77/SpacIO_v1">SpacIO</a> Space by RdnUser77 and Omnibus's Maximum Multiplier!
|
101 |
</p>
|
102 |
""")
|
103 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
js_code = """
|
106 |
|