DemiPoto commited on
Commit
04cf984
1 Parent(s): c274660

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -51,10 +51,12 @@ def choice_group_a(group_model_choice):
51
  choice=m
52
  return choice
53
 
54
- def choice_group_b(choice):
 
55
  return [gr.Image(label=m, min_width=170, height=170) for m in choice]
56
 
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):
@@ -106,7 +108,6 @@ def make_me():
106
  for m, o in zip(current_models, output):
107
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
108
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
109
- choicesT=choices
110
  """with gr.Accordion('Model selection'):
111
  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)
112
  model_choice.change(update_imgbox, (gen_button,stop_button,group_model_choice), output)
@@ -117,9 +118,8 @@ def make_me():
117
  """
118
  with gr.Accordion("test", open=True):
119
  group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
120
- group_model_choice.change(choice_group_a,group_model_choice,choicesT)
121
- group_model_choice.change(choice_group_b,choicesT,output)
122
- group_model_choice.change(choice_group_c,choicesT,current_models)
123
  group_model_choice.change(choice_group_d,(gen_button,stop_button,output,current_models),gen_event)
124
  with gr.Row():
125
  gr.HTML("""
 
51
  choice=m
52
  return choice
53
 
54
+ def choice_group_b(group_model_choice):
55
+ choice=choice_group_a(group_model_choice)
56
  return [gr.Image(label=m, min_width=170, height=170) for m in choice]
57
 
58
+ def choice_group_c(group_model_choice):
59
+ choice=choice_group_a(group_model_choice)
60
  return [gr.Textbox(m, visible=False) for m in choice]
61
 
62
  def choice_groupe_d(var_Test):
 
108
  for m, o in zip(current_models, output):
109
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
110
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
 
111
  """with gr.Accordion('Model selection'):
112
  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)
113
  model_choice.change(update_imgbox, (gen_button,stop_button,group_model_choice), output)
 
118
  """
119
  with gr.Accordion("test", open=True):
120
  group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
121
+ group_model_choice.change(choice_group_b,group_model_choice,output)
122
+ group_model_choice.change(choice_group_c,group_model_choice,current_models)
 
123
  group_model_choice.change(choice_group_d,(gen_button,stop_button,output,current_models),gen_event)
124
  with gr.Row():
125
  gr.HTML("""