Matthew
commited on
Commit
·
07f0062
1
Parent(s):
cf2a952
Add system prompt and reduce number of questions submitted for speed
Browse files
agent.py
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 1 |
from smolagents import (
|
| 2 |
CodeAgent,
|
| 3 |
-
|
| 4 |
)
|
| 5 |
|
| 6 |
class DRAgent:
|
| 7 |
def __init__(self):
|
|
|
|
|
|
|
| 8 |
self.agent = CodeAgent(
|
| 9 |
tools=[],
|
| 10 |
-
model
|
|
|
|
|
|
|
| 11 |
)
|
| 12 |
print("BasicAgent initialized.")
|
| 13 |
def __call__(self, question: str) -> str:
|
|
|
|
| 1 |
from smolagents import (
|
| 2 |
CodeAgent,
|
| 3 |
+
InferenceClientModel,
|
| 4 |
)
|
| 5 |
|
| 6 |
class DRAgent:
|
| 7 |
def __init__(self):
|
| 8 |
+
self.system_prompt = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."
|
| 9 |
+
|
| 10 |
self.agent = CodeAgent(
|
| 11 |
tools=[],
|
| 12 |
+
model=InferenceClientModel(
|
| 13 |
+
model_id="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"
|
| 14 |
+
),
|
| 15 |
)
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
def __call__(self, question: str) -> str:
|
app.py
CHANGED
|
@@ -76,7 +76,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 76 |
results_log = []
|
| 77 |
answers_payload = []
|
| 78 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 79 |
-
for item in questions_data:
|
| 80 |
task_id = item.get("task_id")
|
| 81 |
question_text = item.get("question")
|
| 82 |
if not task_id or question_text is None:
|
|
|
|
| 76 |
results_log = []
|
| 77 |
answers_payload = []
|
| 78 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 79 |
+
for item in questions_data[:1]: # Reduce the number of submitted questions for speed
|
| 80 |
task_id = item.get("task_id")
|
| 81 |
question_text = item.get("question")
|
| 82 |
if not task_id or question_text is None:
|