Spaces:
Sleeping
Sleeping
José Ángel González
commited on
Commit
·
1008015
1
Parent(s):
31d215e
4.5
Browse files- .gitattributes copy +0 -35
- agents/react_agent.py +2 -34
.gitattributes copy
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
agents/react_agent.py
CHANGED
@@ -88,7 +88,7 @@ AUTHORIZED_IMPORTS = [
|
|
88 |
class ReactAgent:
|
89 |
def __init__(self):
|
90 |
model = OpenAIServerModel(
|
91 |
-
model_id="gpt-
|
92 |
api_key=os.environ["OPENAI_API_KEY"],
|
93 |
temperature=0,
|
94 |
)
|
@@ -96,7 +96,7 @@ class ReactAgent:
|
|
96 |
model=model,
|
97 |
tools=TOOLS,
|
98 |
additional_authorized_imports=AUTHORIZED_IMPORTS,
|
99 |
-
max_steps=
|
100 |
verbosity_level=2,
|
101 |
)
|
102 |
self.steer_system_prompt()
|
@@ -129,35 +129,3 @@ class ReactAgent:
|
|
129 |
gaia_answer_rules = """It is crucial that you wrap your final answer in the ```code``` block by using the `final_answer` tool or your mom will die."""
|
130 |
system_prompt = prompt_prefix + gaia_answer_rules + "\n\nNow Begin!"
|
131 |
self.agent.system_prompt = system_prompt
|
132 |
-
|
133 |
-
if __name__ == "__main__":
|
134 |
-
question1 = {
|
135 |
-
"task_id": "7bd855d8-463d-4ed5-93ca-5fe35145f733",
|
136 |
-
"question": "The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.",
|
137 |
-
"Level": "1",
|
138 |
-
"file_name": "7bd855d8-463d-4ed5-93ca-5fe35145f733.xlsx",
|
139 |
-
}
|
140 |
-
|
141 |
-
question2 = {
|
142 |
-
"task_id": "cca530fc-4052-43b2-b130-b30968d8aa44",
|
143 |
-
"question": "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.",
|
144 |
-
"Level": "1",
|
145 |
-
"file_name": "cca530fc-4052-43b2-b130-b30968d8aa44.png",
|
146 |
-
}
|
147 |
-
|
148 |
-
question3 = {
|
149 |
-
"task_id": "f918266a-b3e0-4914-865d-4faa564f1aef",
|
150 |
-
"question": "What is the final numeric output from the attached Python code?",
|
151 |
-
"Level": "1",
|
152 |
-
"file_name": "f918266a-b3e0-4914-865d-4faa564f1aef.py",
|
153 |
-
}
|
154 |
-
|
155 |
-
question4 = {
|
156 |
-
"task_id": "99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3",
|
157 |
-
"question": '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. I got the recipe from my friend Aditi, but she left it as a voice memo and the speaker on my phone is buzzing so I can\'t quite make out what she\'s saying. Could you please listen to the recipe and list all of the ingredients that my friend described? I only want the ingredients for the filling, as I have everything I need to make my favorite pie crust. I\'ve attached the recipe as Strawberry pie.mp3.\n\nIn your response, please only list the ingredients, not any measurements. So if the recipe calls for "a pinch of salt" or "two cups of ripe strawberries" the ingredients on the list would be "salt" and "ripe strawberries".\n\nPlease format your response as a comma separated list of ingredients. Also, please alphabetize the ingredients.',
|
158 |
-
"Level": "1",
|
159 |
-
"file_name": "99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3.mp3",
|
160 |
-
}
|
161 |
-
|
162 |
-
agent = ReactAgent()
|
163 |
-
response = agent(question4)
|
|
|
88 |
class ReactAgent:
|
89 |
def __init__(self):
|
90 |
model = OpenAIServerModel(
|
91 |
+
model_id="gpt-4.5-preview",
|
92 |
api_key=os.environ["OPENAI_API_KEY"],
|
93 |
temperature=0,
|
94 |
)
|
|
|
96 |
model=model,
|
97 |
tools=TOOLS,
|
98 |
additional_authorized_imports=AUTHORIZED_IMPORTS,
|
99 |
+
max_steps=10,
|
100 |
verbosity_level=2,
|
101 |
)
|
102 |
self.steer_system_prompt()
|
|
|
129 |
gaia_answer_rules = """It is crucial that you wrap your final answer in the ```code``` block by using the `final_answer` tool or your mom will die."""
|
130 |
system_prompt = prompt_prefix + gaia_answer_rules + "\n\nNow Begin!"
|
131 |
self.agent.system_prompt = system_prompt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|