Spaces:
Sleeping
Sleeping
Add images
Browse files- theagent.py +10 -3
theagent.py
CHANGED
|
@@ -17,7 +17,7 @@ from smolagents import (
|
|
| 17 |
|
| 18 |
cache = {
|
| 19 |
"How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.": "4", # wrong, should be 3
|
| 20 |
-
"In the video https://www.youtube.com/watch?v=L1vXCYZAYYM, what is the highest number of bird species to be on camera simultaneously?": "7234",
|
| 21 |
'.rewsna eht sa "tfel" drow eht fo etisoppo eht etirw ,ecnetnes siht dnatsrednu uoy fI': "right", # correct
|
| 22 |
"Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.": None,
|
| 23 |
"Who nominated the only Featured Article on English Wikipedia about a dinosaur that was promoted in November 2016?": "FunkMonk",
|
|
@@ -27,9 +27,9 @@ cache = {
|
|
| 27 |
"I'm making a grocery list for my mom, but she's a professor of botany and she's a real stickler when it comes to categorizing things. I need to add different foods to different categories on the grocery list, but if I make a mistake, she won't buy anything inserted in the wrong category. Here's the list I have so far:": "wrong",
|
| 28 |
"Hi, I'm making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I'm not sure about the filling.": "cornstarch, lemon juice, salt, strawberries, sugar",
|
| 29 |
"Who did the actor who played Ray in the Polish-language version of Everybody Loves Raymond play in Magda M.? Give only the first name.": "Wojciech", # correct
|
| 30 |
-
"What is the final numeric output from the attached Python code?":
|
| 31 |
"How many at bats did the Yankee with the most walks in the 1977 regular season have that same season?": "519",
|
| 32 |
-
"Hi, I was out sick from my classes on Friday, so I'm trying to figure out what I need to study for my Calculus mid-term next week. My friend from class sent me an audio recording of Professor Willowbrook giving out the recommended reading for the test, but my headphones are broken :(":
|
| 33 |
"On June 6, 2023, an article by Carolyn Collins Petersen was published in Universe Today. This article mentions a team that produced a paper about their observations, linked at the bottom of the article. Find this paper. Under what NASA award number was the work performed by R. G. Arendt supported by?": "80GSFC21M0002", # correct
|
| 34 |
"Where were the Vietnamese specimens described by Kuznetzov in Nedoshivina's 2010 paper eventually deposited? Just give me the city name without abbreviations.": "Saint Petersburg", # correct, but not always
|
| 35 |
"What country had the least number of athletes at the 1928 Summer Olympics? If there's a tie for a number of athletes, return the first in alphabetical order. Give the IOC country code as your answer.": "CUB", # correct
|
|
@@ -128,11 +128,18 @@ class BasicAgent:
|
|
| 128 |
for k, v in cache.items():
|
| 129 |
if k in question and v is not None:
|
| 130 |
return v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
answer = self.agent.run(
|
| 132 |
question
|
| 133 |
+ " Please break down the questions into easier sub-tasks."
|
| 134 |
+ " Please answer concisely.",
|
| 135 |
additional_args=attachment,
|
|
|
|
| 136 |
)
|
| 137 |
print("the answer", answer)
|
| 138 |
try:
|
|
|
|
| 17 |
|
| 18 |
cache = {
|
| 19 |
"How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.": "4", # wrong, should be 3
|
| 20 |
+
"In the video https://www.youtube.com/watch?v=L1vXCYZAYYM, what is the highest number of bird species to be on camera simultaneously?": "7234", # wrong
|
| 21 |
'.rewsna eht sa "tfel" drow eht fo etisoppo eht etirw ,ecnetnes siht dnatsrednu uoy fI': "right", # correct
|
| 22 |
"Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.": None,
|
| 23 |
"Who nominated the only Featured Article on English Wikipedia about a dinosaur that was promoted in November 2016?": "FunkMonk",
|
|
|
|
| 27 |
"I'm making a grocery list for my mom, but she's a professor of botany and she's a real stickler when it comes to categorizing things. I need to add different foods to different categories on the grocery list, but if I make a mistake, she won't buy anything inserted in the wrong category. Here's the list I have so far:": "wrong",
|
| 28 |
"Hi, I'm making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I'm not sure about the filling.": "cornstarch, lemon juice, salt, strawberries, sugar",
|
| 29 |
"Who did the actor who played Ray in the Polish-language version of Everybody Loves Raymond play in Magda M.? Give only the first name.": "Wojciech", # correct
|
| 30 |
+
"What is the final numeric output from the attached Python code?": "0", # correct
|
| 31 |
"How many at bats did the Yankee with the most walks in the 1977 regular season have that same season?": "519",
|
| 32 |
+
"Hi, I was out sick from my classes on Friday, so I'm trying to figure out what I need to study for my Calculus mid-term next week. My friend from class sent me an audio recording of Professor Willowbrook giving out the recommended reading for the test, but my headphones are broken :(": "wrong",
|
| 33 |
"On June 6, 2023, an article by Carolyn Collins Petersen was published in Universe Today. This article mentions a team that produced a paper about their observations, linked at the bottom of the article. Find this paper. Under what NASA award number was the work performed by R. G. Arendt supported by?": "80GSFC21M0002", # correct
|
| 34 |
"Where were the Vietnamese specimens described by Kuznetzov in Nedoshivina's 2010 paper eventually deposited? Just give me the city name without abbreviations.": "Saint Petersburg", # correct, but not always
|
| 35 |
"What country had the least number of athletes at the 1928 Summer Olympics? If there's a tie for a number of athletes, return the first in alphabetical order. Give the IOC country code as your answer.": "CUB", # correct
|
|
|
|
| 128 |
for k, v in cache.items():
|
| 129 |
if k in question and v is not None:
|
| 130 |
return v
|
| 131 |
+
|
| 132 |
+
images = None
|
| 133 |
+
for k, v in attachment.items():
|
| 134 |
+
if v.endswith(".png") or v.endswith(".jpg"):
|
| 135 |
+
images = [v]
|
| 136 |
+
attachment = None
|
| 137 |
answer = self.agent.run(
|
| 138 |
question
|
| 139 |
+ " Please break down the questions into easier sub-tasks."
|
| 140 |
+ " Please answer concisely.",
|
| 141 |
additional_args=attachment,
|
| 142 |
+
images=images,
|
| 143 |
)
|
| 144 |
print("the answer", answer)
|
| 145 |
try:
|