Thanh Vinh Vo
commited on
Commit
·
6668ecd
1
Parent(s):
c2b4aa8
update
Browse files
app.py
CHANGED
|
@@ -122,11 +122,11 @@ class BasicAgent:
|
|
| 122 |
max_steps=15,
|
| 123 |
)
|
| 124 |
|
| 125 |
-
def __call__(self, question: str,
|
| 126 |
print(f"Agent received question: {question}")
|
| 127 |
prompt = f"""
|
| 128 |
Answer the following question:
|
| 129 |
-
"{question} {"The file name is: " if
|
| 130 |
|
| 131 |
Please follow hints below:
|
| 132 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
|
@@ -208,7 +208,7 @@ def run_and_submit_all(questions_index: str, profile: gr.OAuthProfile | None):
|
|
| 208 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 209 |
continue
|
| 210 |
try:
|
| 211 |
-
submitted_answer = agent(question_text, file_name)
|
| 212 |
answers_payload.append(
|
| 213 |
{"task_id": task_id, "submitted_answer": submitted_answer}
|
| 214 |
)
|
|
|
|
| 122 |
max_steps=15,
|
| 123 |
)
|
| 124 |
|
| 125 |
+
def __call__(self, question: str, question_id: str, has_file: bool) -> str:
|
| 126 |
print(f"Agent received question: {question}")
|
| 127 |
prompt = f"""
|
| 128 |
Answer the following question:
|
| 129 |
+
"{question} {"The file name for this question is: " if has_file else ""} {question_id}"
|
| 130 |
|
| 131 |
Please follow hints below:
|
| 132 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
|
|
|
| 208 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 209 |
continue
|
| 210 |
try:
|
| 211 |
+
submitted_answer = agent(question_text, task_id, file_name)
|
| 212 |
answers_payload.append(
|
| 213 |
{"task_id": task_id, "submitted_answer": submitted_answer}
|
| 214 |
)
|