Update app.py
Browse files
app.py
CHANGED
@@ -192,7 +192,7 @@ with gr.Blocks() as demo:
|
|
192 |
**Instructions:**
|
193 |
1. Make sure you have set your `GROQ_API_KEY` in the 'Secrets' section of your Space settings.
|
194 |
2. Log in to your Hugging Face account using the button below. This is required for submission.
|
195 |
-
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see your score.
|
196 |
---
|
197 |
**Disclaimers:**
|
198 |
Once you click the "submit" button, the process can take some time as the agent answers all the questions.
|
@@ -200,18 +200,18 @@ with gr.Blocks() as demo:
|
|
200 |
"""
|
201 |
)
|
202 |
|
203 |
-
|
204 |
-
auth_button = gr.LoginButton()
|
205 |
|
206 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
207 |
|
208 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
209 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
210 |
|
211 |
-
# The `
|
|
|
|
|
212 |
run_button.click(
|
213 |
fn=run_and_submit_all,
|
214 |
-
inputs=[auth_button],
|
215 |
outputs=[status_output, results_table]
|
216 |
)
|
217 |
|
@@ -223,7 +223,7 @@ if __name__ == "__main__":
|
|
223 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
224 |
else:
|
225 |
print("ℹ️ SPACE_ID environment variable not found (running locally?).")
|
226 |
-
|
227 |
if not os.getenv("GROQ_API_KEY"):
|
228 |
print("⚠️ WARNING: GROQ_API_KEY secret is not set. The app will fail if run.")
|
229 |
else:
|
|
|
192 |
**Instructions:**
|
193 |
1. Make sure you have set your `GROQ_API_KEY` in the 'Secrets' section of your Space settings.
|
194 |
2. Log in to your Hugging Face account using the button below. This is required for submission.
|
195 |
+
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit your answers, and see your score.
|
196 |
---
|
197 |
**Disclaimers:**
|
198 |
Once you click the "submit" button, the process can take some time as the agent answers all the questions.
|
|
|
200 |
"""
|
201 |
)
|
202 |
|
203 |
+
gr.LoginButton()
|
|
|
204 |
|
205 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
206 |
|
207 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
208 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
209 |
|
210 |
+
# CORRECTED LINE: The `inputs` argument is removed. Gradio passes the
|
211 |
+
# OAuthProfile automatically to the `run_and_submit_all` function
|
212 |
+
# because of the type hint in its definition.
|
213 |
run_button.click(
|
214 |
fn=run_and_submit_all,
|
|
|
215 |
outputs=[status_output, results_table]
|
216 |
)
|
217 |
|
|
|
223 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
224 |
else:
|
225 |
print("ℹ️ SPACE_ID environment variable not found (running locally?).")
|
226 |
+
|
227 |
if not os.getenv("GROQ_API_KEY"):
|
228 |
print("⚠️ WARNING: GROQ_API_KEY secret is not set. The app will fail if run.")
|
229 |
else:
|