keynes42 commited on
Commit
12da333
·
verified ·
1 Parent(s): 01c16cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -324,11 +324,22 @@ with gr.Blocks() as demo:
324
  # Removed max_rows=10 from DataFrame constructor
325
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
326
 
 
327
  run_button.click(
328
- fn=run_and_submit_all,
329
- outputs=[status_output, results_table],
330
- streaming=True
 
 
 
 
 
 
331
  )
 
 
 
 
332
 
333
  if __name__ == "__main__":
334
  print("\n" + "-"*30 + " App Starting " + "-"*30)
 
324
  # Removed max_rows=10 from DataFrame constructor
325
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
326
 
327
+ # 1) First handler: register the user/run event, skip the queue so it happens immediately
328
  run_button.click(
329
+ fn=lambda: None, # no-op or a quick “start” callback
330
+ inputs=[],
331
+ outputs=[],
332
+ queue=False
333
+ ).then(
334
+ # 2) Second handler: your long‐running generator
335
+ fn=run_and_submit_all, # this function must `yield` (status, table)
336
+ inputs=[/* whatever inputs you need */],
337
+ outputs=[status_output, results_table]
338
  )
339
+ # run_button.click(
340
+ # fn=run_and_submit_all,
341
+ # outputs=[status_output, results_table],
342
+ # )
343
 
344
  if __name__ == "__main__":
345
  print("\n" + "-"*30 + " App Starting " + "-"*30)