alberto
commited on
Commit
·
fe3c2bb
1
Parent(s):
6152d82
1st submission
Browse files
app.py
CHANGED
|
@@ -53,18 +53,18 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 53 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 54 |
try:
|
| 55 |
agent = BasicAgent()
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
except Exception as e:
|
| 69 |
print(f"Error instantiating agent: {e}")
|
| 70 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 53 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 54 |
try:
|
| 55 |
agent = BasicAgent()
|
| 56 |
+
agent = CodeAgent(
|
| 57 |
+
model=MODEL,
|
| 58 |
+
max_steps=10,
|
| 59 |
+
tools=[
|
| 60 |
+
DuckDuckGoSearchTool(),
|
| 61 |
+
WikipediaSearchTool(),
|
| 62 |
+
VisitWebpageTool(),
|
| 63 |
+
VisitWikiPageTool(user_agent="hf-agent-course"),
|
| 64 |
+
SpeechToTextTool(),
|
| 65 |
+
PythonInterpreterTool(),
|
| 66 |
+
FinalAnswerTool()])
|
| 67 |
+
agent.prompt_templates["system_prompt"] = system_prompt
|
| 68 |
except Exception as e:
|
| 69 |
print(f"Error instantiating agent: {e}")
|
| 70 |
return f"Error initializing agent: {e}", None
|