Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,6 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from langchain_core.messages import HumanMessage
|
| 7 |
-
from agent import build_graph
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
@@ -17,11 +15,9 @@ class BasicAgent:
|
|
| 17 |
print("BasicAgent initialized.")
|
| 18 |
def __call__(self, question: str) -> str:
|
| 19 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
answer = messages['messages'][-1].content
|
| 24 |
-
return answer[14:]
|
| 25 |
|
| 26 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 27 |
"""
|
|
@@ -150,11 +146,9 @@ with gr.Blocks() as demo:
|
|
| 150 |
gr.Markdown(
|
| 151 |
"""
|
| 152 |
**Instructions:**
|
| 153 |
-
|
| 154 |
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
| 155 |
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
| 156 |
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
| 157 |
-
|
| 158 |
---
|
| 159 |
**Disclaimers:**
|
| 160 |
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).
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# (Keep Constants as is)
|
| 8 |
# --- Constants ---
|
|
|
|
| 15 |
print("BasicAgent initialized.")
|
| 16 |
def __call__(self, question: str) -> str:
|
| 17 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 18 |
+
fixed_answer = "This is a default answer."
|
| 19 |
+
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 20 |
+
return fixed_answer
|
|
|
|
|
|
|
| 21 |
|
| 22 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 23 |
"""
|
|
|
|
| 146 |
gr.Markdown(
|
| 147 |
"""
|
| 148 |
**Instructions:**
|
|
|
|
| 149 |
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
| 150 |
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
| 151 |
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
|
|
|
| 152 |
---
|
| 153 |
**Disclaimers:**
|
| 154 |
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).
|