Pamudu13 commited on
Commit
13c46fd
·
verified ·
1 Parent(s): 6d17160

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -26,8 +26,8 @@ for model_path in models:
26
 
27
  def send_it_idx(idx):
28
  def send_it_fn(prompt):
29
- output = (model_functions.get(idx) or model_functions.get(1)).predict(prompt)
30
- return output
31
  return send_it_fn
32
 
33
  def get_prompts(prompt_text):
@@ -71,7 +71,6 @@ with gr.Blocks(title="SD Models") as my_interface:
71
  end_box = gr.Number(visible=False)
72
  tog_box = gr.Textbox(value=0, visible=False)
73
 
74
- # Define event handlers within the Blocks context
75
  def main_function(prompt):
76
  return {idx: run_model(prompt, idx) for idx in range(1, len(models) + 1)}
77
 
@@ -104,5 +103,4 @@ with gr.Blocks(title="SD Models") as my_interface:
104
  outputs=tog_box
105
  )
106
 
107
- # Launch the interface
108
  my_interface.launch(max_threads=10)
 
26
 
27
  def send_it_idx(idx):
28
  def send_it_fn(prompt):
29
+ model = model_functions.get(idx, model_functions.get(1))
30
+ return model.predict(prompt)
31
  return send_it_fn
32
 
33
  def get_prompts(prompt_text):
 
71
  end_box = gr.Number(visible=False)
72
  tog_box = gr.Textbox(value=0, visible=False)
73
 
 
74
  def main_function(prompt):
75
  return {idx: run_model(prompt, idx) for idx in range(1, len(models) + 1)}
76
 
 
103
  outputs=tog_box
104
  )
105
 
 
106
  my_interface.launch(max_threads=10)