Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -15,11 +15,11 @@ def load_tasks():
|
|
| 15 |
with open("metadata.jsonl", "r", encoding="utf-8") as f:
|
| 16 |
for line in f:
|
| 17 |
item = json.loads(line)
|
| 18 |
-
|
| 19 |
question = item.get("Question") or item.get("question")
|
| 20 |
if question_id and question:
|
| 21 |
tasks.append({
|
| 22 |
-
"
|
| 23 |
"question": question
|
| 24 |
})
|
| 25 |
return tasks
|
|
@@ -34,7 +34,7 @@ def solve_task(task, tools=TOOLS):
|
|
| 34 |
response = mistral.run(prompt)
|
| 35 |
|
| 36 |
return {
|
| 37 |
-
"
|
| 38 |
"question": task["question"],
|
| 39 |
"submitted_answer": response.strip() if response else "ERROR: Empty model response"
|
| 40 |
}
|
|
|
|
| 15 |
with open("metadata.jsonl", "r", encoding="utf-8") as f:
|
| 16 |
for line in f:
|
| 17 |
item = json.loads(line)
|
| 18 |
+
task_id = item.get("task_id")
|
| 19 |
question = item.get("Question") or item.get("question")
|
| 20 |
if question_id and question:
|
| 21 |
tasks.append({
|
| 22 |
+
"task_id": task_id,
|
| 23 |
"question": question
|
| 24 |
})
|
| 25 |
return tasks
|
|
|
|
| 34 |
response = mistral.run(prompt)
|
| 35 |
|
| 36 |
return {
|
| 37 |
+
"task_id": task["task_id"],
|
| 38 |
"question": task["question"],
|
| 39 |
"submitted_answer": response.strip() if response else "ERROR: Empty model response"
|
| 40 |
}
|