Scott Cogan commited on
Commit
263eda6
·
1 Parent(s): e3b1f8b
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -366,16 +366,27 @@ with gr.Blocks() as demo:
366
  """
367
  )
368
 
369
- gr.LoginButton()
370
-
371
- run_button = gr.Button("Run Evaluation & Submit All Answers")
372
 
373
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
374
- # Removed max_rows=10 from DataFrame constructor
375
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
376
 
 
 
 
 
 
 
 
 
 
 
 
377
  run_button.click(
378
  fn=run_and_submit_all,
 
379
  outputs=[status_output, results_table]
380
  )
381
 
 
366
  """
367
  )
368
 
369
+ with gr.Row():
370
+ login_button = gr.LoginButton()
371
+ run_button = gr.Button("Run Evaluation & Submit All Answers", interactive=False)
372
 
373
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
 
374
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
375
 
376
+ def enable_run_button(profile):
377
+ if profile:
378
+ return gr.Button.update(interactive=True)
379
+ return gr.Button.update(interactive=False)
380
+
381
+ login_button.click(
382
+ fn=enable_run_button,
383
+ inputs=[login_button],
384
+ outputs=[run_button]
385
+ )
386
+
387
  run_button.click(
388
  fn=run_and_submit_all,
389
+ inputs=[login_button],
390
  outputs=[status_output, results_table]
391
  )
392