Spaces:
Sleeping
Sleeping
Fix app agent
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
|
|
|
| 6 |
from agent import agent_graph
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
|
@@ -43,7 +44,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 43 |
|
| 44 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 45 |
try:
|
| 46 |
-
agent =
|
| 47 |
except Exception as e:
|
| 48 |
print(f"Error instantiating agent: {e}")
|
| 49 |
return f"Error initializing agent: {e}", None
|
|
@@ -148,15 +149,11 @@ with gr.Blocks() as demo:
|
|
| 148 |
gr.Markdown("# Basic Agent Evaluation Runner")
|
| 149 |
gr.Markdown(
|
| 150 |
"""
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
| 154 |
-
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
| 155 |
-
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
| 156 |
|
| 157 |
---
|
| 158 |
**Disclaimers:**
|
| 159 |
-
Once clicking on the "submit button, it can take quite some time (
|
| 160 |
This space provides a basic setup and is intentionally sub-optimal to encourage you to develop your own, more robust solution. For instance for the delay process of the submit button, a solution could be to cache the answers and submit in a seperate action or even to answer the questions in async.
|
| 161 |
"""
|
| 162 |
)
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from langchain_core.messages import HumanMessage
|
| 7 |
from agent import agent_graph
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 44 |
|
| 45 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 46 |
try:
|
| 47 |
+
agent = BasicAgent()
|
| 48 |
except Exception as e:
|
| 49 |
print(f"Error instantiating agent: {e}")
|
| 50 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 149 |
gr.Markdown("# Basic Agent Evaluation Runner")
|
| 150 |
gr.Markdown(
|
| 151 |
"""
|
| 152 |
+
Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
---
|
| 155 |
**Disclaimers:**
|
| 156 |
+
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).
|
| 157 |
This space provides a basic setup and is intentionally sub-optimal to encourage you to develop your own, more robust solution. For instance for the delay process of the submit button, a solution could be to cache the answers and submit in a seperate action or even to answer the questions in async.
|
| 158 |
"""
|
| 159 |
)
|