charliebaby2023 commited on
Commit
c03394e
·
verified ·
1 Parent(s): 0749675

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -43,6 +43,14 @@ def gen_fn(model_str, prompt):
43
  noise = str(randint(0, 9999))
44
  return models_load[model_str](f'{prompt} {noise}')
45
 
 
 
 
 
 
 
 
 
46
  def make_me():
47
  with gr.Row():
48
  txt_input = gr.Textbox(lines=2, value=kii)
@@ -65,8 +73,7 @@ def make_me():
65
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
66
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
67
  with gr.Accordion('Model selection'):
68
- #model_choice = gr.CheckboxGroup(models, label=f' {num_models} different models selected', value=default_models, max_choices=num_models, interactive=True, filterable=False)
69
- model_choice = gr.CheckboxGroup(models, label=f' {num_models} different models selected', value=default_models, interactive=True)
70
  model_choice.change(update_imgbox, model_choice, output)
71
  model_choice.change(extend_choices, model_choice, current_models)
72
 
 
43
  noise = str(randint(0, 9999))
44
  return models_load[model_str](f'{prompt} {noise}')
45
 
46
+ def process_choices(selected_choices):
47
+ results = []
48
+ for choice in selected_choices:
49
+ results.append(f"Processed data for {choice}") # Example output for each model
50
+ return results # Return a separate output for each choice
51
+
52
+
53
+
54
  def make_me():
55
  with gr.Row():
56
  txt_input = gr.Textbox(lines=2, value=kii)
 
73
  gen_event = gen_button.click(gen_fn, [m, txt_input], o)
74
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
75
  with gr.Accordion('Model selection'):
76
+ model_choice = gr.CheckboxGroup(models, label=f' {num_models} different models selected', value=default_models, max_choices=num_models, interactive=True, filterable=False)
 
77
  model_choice.change(update_imgbox, model_choice, output)
78
  model_choice.change(extend_choices, model_choice, current_models)
79