dmfelder commited on
Commit
e362025
·
verified ·
1 Parent(s): 8245927

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -496,6 +496,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
496
  agent.cleanup()
497
 
498
 
 
499
  # --- Build Gradio Interface using Blocks (as per template) ---
500
  with gr.Blocks() as demo:
501
  gr.Markdown("# Hugging Face Agent Certification Runner")
@@ -510,23 +511,26 @@ with gr.Blocks() as demo:
510
  The evaluation process can take significant time as your agent goes through all questions. Progress updates will be shown below.
511
  """
512
  )
513
- gr.LoginButton() # This handles the username for you
 
 
514
 
515
  run_button = gr.Button("🚀 Run Evaluation & Submit All Answers")
516
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
517
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
518
 
519
- # The click event now passes the profile directly from the LoginButton
520
- # Store the login button in a variable to use it as an input
521
- login_button_component = gr.LoginButton()
522
-
523
  run_button.click(
524
  fn=run_and_submit_all,
525
- inputs=[login_button_component], # <--- Pass the component variable here
526
  outputs=[status_output, results_table],
527
- show_progress=True,
528
  )
529
 
 
 
 
 
530
  if __name__ == "__main__":
531
  print("\n" + "-"*30 + " App Starting " + "-"*30)
532
  space_host_startup = os.getenv("SPACE_HOST")
 
496
  agent.cleanup()
497
 
498
 
499
+ # --- Build Gradio Interface using Blocks (as per template) ---
500
  # --- Build Gradio Interface using Blocks (as per template) ---
501
  with gr.Blocks() as demo:
502
  gr.Markdown("# Hugging Face Agent Certification Runner")
 
511
  The evaluation process can take significant time as your agent goes through all questions. Progress updates will be shown below.
512
  """
513
  )
514
+
515
+ # Store the LoginButton in a variable FIRST
516
+ login_button_component = gr.LoginButton()
517
 
518
  run_button = gr.Button("🚀 Run Evaluation & Submit All Answers")
519
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
520
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
521
 
522
+ # Now, use the variable for the input
 
 
 
523
  run_button.click(
524
  fn=run_and_submit_all,
525
+ inputs=[login_button_component], # <<< THIS IS THE KEY CHANGE >>>
526
  outputs=[status_output, results_table],
527
+ show_progress=True, # Show Gradio's internal progress bar
528
  )
529
 
530
+ if __name__ == "__main__":
531
+ # ... (rest of your launch code) ...
532
+ demo.launch(debug=True, share=False)
533
+
534
  if __name__ == "__main__":
535
  print("\n" + "-"*30 + " App Starting " + "-"*30)
536
  space_host_startup = os.getenv("SPACE_HOST")