Update app.py
Browse files
app.py
CHANGED
@@ -30,15 +30,18 @@ def gen_fn(model_str, prompt, width, height):
|
|
30 |
if model_str == 'NA':
|
31 |
return None
|
32 |
noise = str(randint(0, 99999999999))
|
33 |
-
# Annahme: Die Modelle akzeptieren width und height Parameter
|
34 |
return models_load[model_str](f'{prompt} {noise}')
|
35 |
|
36 |
with gr.Blocks() as demo:
|
37 |
with gr.Tab('Multiple models'):
|
38 |
with gr.Accordion('Model selection'):
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
|
43 |
txt_input = gr.Textbox(label='Prompt text')
|
44 |
with gr.Row():
|
@@ -59,7 +62,7 @@ with gr.Blocks() as demo:
|
|
59 |
gen_event = gen_button.click(gen_fn, [m, txt_input, width_slider, height_slider], o, queue=False)
|
60 |
|
61 |
with gr.Tab('Single model'):
|
62 |
-
model_choice2 = gr.Dropdown(models, label='Choose model', value=models[0]
|
63 |
txt_input2 = gr.Textbox(label='Prompt text')
|
64 |
|
65 |
with gr.Row():
|
|
|
30 |
if model_str == 'NA':
|
31 |
return None
|
32 |
noise = str(randint(0, 99999999999))
|
|
|
33 |
return models_load[model_str](f'{prompt} {noise}')
|
34 |
|
35 |
with gr.Blocks() as demo:
|
36 |
with gr.Tab('Multiple models'):
|
37 |
with gr.Accordion('Model selection'):
|
38 |
+
# Entferne multiselect und max_choices, da sie nicht mehr unterstützt werden
|
39 |
+
model_choice = gr.CheckboxGroup(
|
40 |
+
choices=models,
|
41 |
+
label=f'Choose up to {num_models} different models',
|
42 |
+
value=default_models,
|
43 |
+
interactive=True
|
44 |
+
)
|
45 |
|
46 |
txt_input = gr.Textbox(label='Prompt text')
|
47 |
with gr.Row():
|
|
|
62 |
gen_event = gen_button.click(gen_fn, [m, txt_input, width_slider, height_slider], o, queue=False)
|
63 |
|
64 |
with gr.Tab('Single model'):
|
65 |
+
model_choice2 = gr.Dropdown(models, label='Choose model', value=models[0])
|
66 |
txt_input2 = gr.Textbox(label='Prompt text')
|
67 |
|
68 |
with gr.Row():
|