Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,10 @@ load_fn(models)
|
|
29 |
|
30 |
|
31 |
num_models = 2
|
|
|
32 |
default_models = models[:num_models]
|
33 |
inference_timeout = 600
|
34 |
|
35 |
-
|
36 |
def extend_choices(choices):
|
37 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
38 |
|
@@ -75,7 +75,8 @@ with gr.Blocks() as demo:
|
|
75 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
76 |
stop_button.click(lambda s: gr.update(interactive = False), None, stop_button, cancels = [gen_event])
|
77 |
with gr.Accordion('Model selection'):
|
78 |
-
model_choice = gr.CheckboxGroup(models, label = f'Choose up to {num_models} different models from the
|
|
|
79 |
model_choice.change(update_imgbox, model_choice, output)
|
80 |
model_choice.change(extend_choices, model_choice, current_models)
|
81 |
with gr.Row():
|
|
|
29 |
|
30 |
|
31 |
num_models = 2
|
32 |
+
max_images = 2
|
33 |
default_models = models[:num_models]
|
34 |
inference_timeout = 600
|
35 |
|
|
|
36 |
def extend_choices(choices):
|
37 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
38 |
|
|
|
75 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
76 |
stop_button.click(lambda s: gr.update(interactive = False), None, stop_button, cancels = [gen_event])
|
77 |
with gr.Accordion('Model selection'):
|
78 |
+
model_choice = gr.CheckboxGroup(models, label = f'Choose up to {int(num_models)} different models from the {len(models)} available!', value=default_models, interactive=True)
|
79 |
+
#model_choice = gr.CheckboxGroup(models, label = f'Choose up to {num_models} different models from the 2 available! Untick them to only use one!', value = default_models, multiselect = True, max_choices = num_models, interactive = True, filterable = False)
|
80 |
model_choice.change(update_imgbox, model_choice, output)
|
81 |
model_choice.change(extend_choices, model_choice, current_models)
|
82 |
with gr.Row():
|