DemiPoto commited on
Commit
4a46f7b
·
verified ·
1 Parent(s): b93810d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -54,7 +54,9 @@ load_fn(models)"""
54
 
55
 
56
  def extend_choices(choices):
57
- return choices + (num_models - len(choices)) * ['NA']
 
 
58
 
59
  def update_imgbox(choices):
60
  choices_plus = extend_choices(choices)
@@ -116,8 +118,10 @@ def make_me():
116
  current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
117
  """choices=[models_test[0][0]]"""
118
  choices=models_test[0]
119
- output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
120
- current_models = [gr.Textbox(m, visible=False) for m in choices]
 
 
121
 
122
  for m, o in zip(current_models, output):
123
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
@@ -127,9 +131,7 @@ def make_me():
127
  model_choice.change(update_imgbox, (gen_button,stop_button,group_model_choice), output)
128
  model_choice.change(extend_choices, model_choice, current_models)
129
  """
130
- """with gr.Accordion('Group Model selection'):
131
- 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)
132
- """
133
  with gr.Accordion("test", open=True):
134
  group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
135
  """group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list([]) , allow_custom_value=True)"""
 
54
 
55
 
56
  def extend_choices(choices):
57
+ nb_models
58
+ return choices + (nb_models - len(choices)) * ['NA']
59
+ """return choices + (num_models - len(choices)) * ['NA']"""
60
 
61
  def update_imgbox(choices):
62
  choices_plus = extend_choices(choices)
 
118
  current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
119
  """choices=[models_test[0][0]]"""
120
  choices=models_test[0]
121
+ """output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
122
+ current_models = [gr.Textbox(m, visible=False) for m in choices]"""
123
+ output = update_imgbox([choices[0][0]])
124
+ current_models = extend_choices([choices[0][0]])
125
 
126
  for m, o in zip(current_models, output):
127
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
 
131
  model_choice.change(update_imgbox, (gen_button,stop_button,group_model_choice), output)
132
  model_choice.change(extend_choices, model_choice, current_models)
133
  """
134
+
 
 
135
  with gr.Accordion("test", open=True):
136
  group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
137
  """group_model_choice = gr.Dropdown(label="test Model", show_label=False, choices=list([]) , allow_custom_value=True)"""