Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import inspect
|
|
4 |
import gradio as gr
|
5 |
import requests
|
6 |
import pandas as pd
|
|
|
7 |
from langchain_core.messages import HumanMessage
|
8 |
from agent import build_graph
|
9 |
|
@@ -92,6 +93,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
92 |
if not task_id or question_text is None:
|
93 |
print(f"Skipping item with missing task_id or question: {item}")
|
94 |
continue
|
|
|
|
|
|
|
95 |
try:
|
96 |
submitted_answer = agent(question_text)
|
97 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
@@ -159,11 +163,9 @@ with gr.Blocks() as demo:
|
|
159 |
gr.Markdown(
|
160 |
"""
|
161 |
**Instructions:**
|
162 |
-
|
163 |
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
164 |
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
165 |
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
166 |
-
|
167 |
---
|
168 |
**Disclaimers:**
|
169 |
Once clicking on the "submit button, it can take quite some time ( this is the time for the agent to go through all the questions).
|
@@ -206,4 +208,4 @@ if __name__ == "__main__":
|
|
206 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
207 |
|
208 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
209 |
-
demo.launch(debug=True, share=False)
|
|
|
4 |
import gradio as gr
|
5 |
import requests
|
6 |
import pandas as pd
|
7 |
+
import time
|
8 |
from langchain_core.messages import HumanMessage
|
9 |
from agent import build_graph
|
10 |
|
|
|
93 |
if not task_id or question_text is None:
|
94 |
print(f"Skipping item with missing task_id or question: {item}")
|
95 |
continue
|
96 |
+
|
97 |
+
# time.sleep(10)
|
98 |
+
|
99 |
try:
|
100 |
submitted_answer = agent(question_text)
|
101 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
|
|
163 |
gr.Markdown(
|
164 |
"""
|
165 |
**Instructions:**
|
|
|
166 |
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
167 |
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
168 |
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
|
|
169 |
---
|
170 |
**Disclaimers:**
|
171 |
Once clicking on the "submit button, it can take quite some time ( this is the time for the agent to go through all the questions).
|
|
|
208 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
209 |
|
210 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
211 |
+
demo.launch(debug=True, share=False)
|