Update app.py
Browse files
app.py
CHANGED
@@ -241,7 +241,7 @@ class BasicAgent:
|
|
241 |
self.agent = CodeAgent(
|
242 |
model=model,
|
243 |
tools=[final_answer, search_tool, visit_webpage_tool, image_description_tool, audio_description_tool, video_prompt_tool],
|
244 |
-
max_steps=
|
245 |
verbosity_level=1,
|
246 |
additional_authorized_imports=[
|
247 |
"unicodedata",
|
@@ -339,7 +339,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
339 |
# question_text = f"{question_text} Here is the file: https://agents-course-unit4-scoring.hf.space/files/{item.get('task_id')}"
|
340 |
question_text = f"{question_text} Here is the local file path: files/{item.get('file_name')}"
|
341 |
|
342 |
-
# wikipedia
|
343 |
# if item.get("task_id") == "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8"
|
344 |
|
345 |
# chess image
|
@@ -349,12 +349,13 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
349 |
# if item.get("task_id") == "f918266a-b3e0-4914-865d-4faa564f1aef":
|
350 |
# submitted_answer = agent(question_text)
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
356 |
|
357 |
-
|
358 |
|
359 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
360 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
@@ -368,7 +369,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
368 |
print("Agent did not produce any answers to submit.")
|
369 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
370 |
|
371 |
-
return "Questions parsed.", pd.DataFrame(results_log)
|
372 |
|
373 |
# 4. Prepare Submission
|
374 |
submission_data = {"username": username.strip(), "agent_code": agent_code, "answers": answers_payload}
|
|
|
241 |
self.agent = CodeAgent(
|
242 |
model=model,
|
243 |
tools=[final_answer, search_tool, visit_webpage_tool, image_description_tool, audio_description_tool, video_prompt_tool],
|
244 |
+
max_steps=10,
|
245 |
verbosity_level=1,
|
246 |
additional_authorized_imports=[
|
247 |
"unicodedata",
|
|
|
339 |
# question_text = f"{question_text} Here is the file: https://agents-course-unit4-scoring.hf.space/files/{item.get('task_id')}"
|
340 |
question_text = f"{question_text} Here is the local file path: files/{item.get('file_name')}"
|
341 |
|
342 |
+
# wikipedia article nomination
|
343 |
# if item.get("task_id") == "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8"
|
344 |
|
345 |
# chess image
|
|
|
349 |
# if item.get("task_id") == "f918266a-b3e0-4914-865d-4faa564f1aef":
|
350 |
# submitted_answer = agent(question_text)
|
351 |
|
352 |
+
# youtube video
|
353 |
+
# if item.get("task_id") == "a1e91b78-d3d8-4675-bb8d-62741b4b68a6":
|
354 |
+
# submitted_answer = agent(question_text)
|
355 |
+
# else:
|
356 |
+
# continue
|
357 |
|
358 |
+
submitted_answer = agent(question_text)
|
359 |
|
360 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
361 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
|
|
369 |
print("Agent did not produce any answers to submit.")
|
370 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
371 |
|
372 |
+
# return "Questions parsed.", pd.DataFrame(results_log)
|
373 |
|
374 |
# 4. Prepare Submission
|
375 |
submission_data = {"username": username.strip(), "agent_code": agent_code, "answers": answers_payload}
|