Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,11 @@ def get_current_time():
|
|
| 15 |
|
| 16 |
def load_fn(models):
|
| 17 |
global models_load
|
|
|
|
|
|
|
| 18 |
models_load = {}
|
|
|
|
|
|
|
| 19 |
for model in models:
|
| 20 |
if model not in models_load.keys():
|
| 21 |
try:
|
|
@@ -27,8 +31,6 @@ def load_fn(models):
|
|
| 27 |
models = models_test[1]
|
| 28 |
load_fn(models)
|
| 29 |
|
| 30 |
-
num_models = len(models)
|
| 31 |
-
default_models = models[:num_models]
|
| 32 |
|
| 33 |
|
| 34 |
def extend_choices(choices):
|
|
@@ -70,19 +72,25 @@ def make_me():
|
|
| 70 |
model_choice.change(update_imgbox, model_choice, output)
|
| 71 |
model_choice.change(extend_choices, model_choice, current_models)
|
| 72 |
|
| 73 |
-
with gr.Accordion('Group Model selection'):
|
| 74 |
group_model_choice = gr.CheckboxGroup(models_test, label=f' {len(models_test)} different group models', value=1, multiselect=False, max_choices=1, interactive=True, filterable=False)
|
| 75 |
-
|
| 76 |
with gr.Accordion("test", open=True):
|
| 77 |
-
|
|
|
|
| 78 |
with gr.Row():
|
| 79 |
gr.HTML("""
|
| 80 |
<div class="footer">
|
| 81 |
<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!
|
| 82 |
</p>
|
| 83 |
""")
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
js_code = """
|
| 88 |
|
|
|
|
| 15 |
|
| 16 |
def load_fn(models):
|
| 17 |
global models_load
|
| 18 |
+
global num_models
|
| 19 |
+
global default_models
|
| 20 |
models_load = {}
|
| 21 |
+
num_models = len(models)
|
| 22 |
+
default_models = models[:num_models]
|
| 23 |
for model in models:
|
| 24 |
if model not in models_load.keys():
|
| 25 |
try:
|
|
|
|
| 31 |
models = models_test[1]
|
| 32 |
load_fn(models)
|
| 33 |
|
|
|
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
def extend_choices(choices):
|
|
|
|
| 72 |
model_choice.change(update_imgbox, model_choice, output)
|
| 73 |
model_choice.change(extend_choices, model_choice, current_models)
|
| 74 |
|
| 75 |
+
"""with gr.Accordion('Group Model selection'):
|
| 76 |
group_model_choice = gr.CheckboxGroup(models_test, label=f' {len(models_test)} different group models', value=1, multiselect=False, max_choices=1, interactive=True, filterable=False)
|
| 77 |
+
"""
|
| 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 |
+
def choice_group_a(group_model_choice):
|
| 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 |
|