civerson916 commited on
Commit
64e1e58
·
verified ·
1 Parent(s): ab5f5d8

Update app.py

Browse files

Fixed login checks and test return values

Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -50,17 +50,17 @@ def run_one(profile: gr.OAuthProfile | None) -> pd.DataFrame:
50
  return "You are logged in.", EMPTY_RESULTS_TABLE
51
 
52
  def run_all(profile: gr.OAuthProfile | None) -> pd.DataFrame:
53
- if not user_logged_in:
54
  return LOGIN_MESSAGE, EMPTY_RESULTS_TABLE
55
  # questions = evaluator.get_questions()
56
  # return "Answer all 20 questions...", runner.run_agent(questions)
57
  return "You are logged in.", EMPTY_RESULTS_TABLE
58
 
59
- def submit():
60
- if not user_logged_in:
61
  return LOGIN_MESSAGE
62
  # evaluator.submit_answers()
63
- return "You are logged in.", EMPTY_RESULTS_TABLE
64
 
65
 
66
  # --- Build Gradio Interface using Blocks ---
@@ -70,9 +70,9 @@ with gr.Blocks() as demo:
70
  """
71
  **Instructions:**
72
 
73
- 1. Log in to your Hugging Face account using the button below. This will NOT use your HF username for submission.
74
- 2. Click 'Get One Answer' to fetch a ranodom question or 'Get All Answers' to run the agent.
75
- 3. Click 'Submit All Answers' to submit answers for evaluation and see the score.
76
 
77
  ---
78
  **Disclaimers:**
@@ -85,8 +85,8 @@ with gr.Blocks() as demo:
85
  gr.LoginButton()
86
 
87
  run_one_button = gr.Button("Get One Answer")
88
- run_all_button = gr.Button("Run Full Evaluation")
89
- submit_button = gr.Button("Submit All Answers")
90
 
91
  status_output = gr.Textbox(
92
  label="Run Status / Submission Result", lines=5, interactive=False)
 
50
  return "You are logged in.", EMPTY_RESULTS_TABLE
51
 
52
  def run_all(profile: gr.OAuthProfile | None) -> pd.DataFrame:
53
+ if not user_logged_in(profile):
54
  return LOGIN_MESSAGE, EMPTY_RESULTS_TABLE
55
  # questions = evaluator.get_questions()
56
  # return "Answer all 20 questions...", runner.run_agent(questions)
57
  return "You are logged in.", EMPTY_RESULTS_TABLE
58
 
59
+ def submit(profile: gr.OAuthProfile | None):
60
+ if not user_logged_in(profile):
61
  return LOGIN_MESSAGE
62
  # evaluator.submit_answers()
63
+ return "You are logged in."
64
 
65
 
66
  # --- Build Gradio Interface using Blocks ---
 
70
  """
71
  **Instructions:**
72
 
73
+ 1. Log in to your Hugging Face account using the button below.
74
+ 2. Click 'Get One Answer' to run the agent on a random question or 'Get All Answers' to run all.
75
+ 3. Click 'Submit Answers' to submit answers for evaluation. This will NOT submit your HF username.
76
 
77
  ---
78
  **Disclaimers:**
 
85
  gr.LoginButton()
86
 
87
  run_one_button = gr.Button("Get One Answer")
88
+ run_all_button = gr.Button("Get All Answers")
89
+ submit_button = gr.Button("Submit Answers")
90
 
91
  status_output = gr.Textbox(
92
  label="Run Status / Submission Result", lines=5, interactive=False)