Update app.py
Browse filesFixed login checks and test return values
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."
|
| 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.
|
| 74 |
-
2. Click 'Get One Answer' to
|
| 75 |
-
3. Click 'Submit
|
| 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("
|
| 89 |
-
submit_button = gr.Button("Submit
|
| 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)
|