Spaces:
Sleeping
Sleeping
Upload tool
Browse files- agent.json +8 -8
- app.py +2 -9
- requirements.txt +2 -2
- tools/visit_webpage.py +1 -1
agent.json
CHANGED
|
@@ -35,17 +35,17 @@
|
|
| 35 |
"name": null,
|
| 36 |
"description": null,
|
| 37 |
"authorized_imports": [
|
| 38 |
-
"
|
| 39 |
-
"itertools",
|
| 40 |
-
"pandas",
|
| 41 |
-
"unicodedata",
|
| 42 |
-
"re",
|
| 43 |
-
"statistics",
|
| 44 |
"collections",
|
| 45 |
-
"datetime",
|
| 46 |
"random",
|
|
|
|
| 47 |
"stat",
|
|
|
|
|
|
|
|
|
|
| 48 |
"queue",
|
| 49 |
-
"
|
|
|
|
|
|
|
| 50 |
]
|
| 51 |
}
|
|
|
|
| 35 |
"name": null,
|
| 36 |
"description": null,
|
| 37 |
"authorized_imports": [
|
| 38 |
+
"math",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
"collections",
|
|
|
|
| 40 |
"random",
|
| 41 |
+
"time",
|
| 42 |
"stat",
|
| 43 |
+
"re",
|
| 44 |
+
"unicodedata",
|
| 45 |
+
"pandas",
|
| 46 |
"queue",
|
| 47 |
+
"statistics",
|
| 48 |
+
"datetime",
|
| 49 |
+
"itertools"
|
| 50 |
]
|
| 51 |
}
|
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from scripts.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
|
| 9 |
model = HfApiModel(
|
| 10 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 11 |
custom_role_conversions=None,
|
| 12 |
)
|
| 13 |
|
|
@@ -19,20 +19,13 @@ final_answer = FinalAnswerTool()
|
|
| 19 |
agent = CodeAgent(
|
| 20 |
model=model,
|
| 21 |
tools=[web_search, visit_webpage, final_answer],
|
| 22 |
-
|
| 23 |
max_steps=6,
|
| 24 |
-
|
| 25 |
verbosity_level=1,
|
| 26 |
-
|
| 27 |
grammar=None,
|
| 28 |
-
|
| 29 |
planning_interval=None,
|
| 30 |
-
|
| 31 |
name=None,
|
| 32 |
-
|
| 33 |
description=None,
|
| 34 |
-
|
| 35 |
-
authorized_imports=['time', 'itertools', 'pandas', 'unicodedata', 're', 'statistics', 'collections', 'datetime', 'random', 'stat', 'queue', 'math'],
|
| 36 |
|
| 37 |
prompts_path='./prompts.yaml'
|
| 38 |
)
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
model = HfApiModel(
|
| 10 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 11 |
custom_role_conversions=None,
|
| 12 |
)
|
| 13 |
|
|
|
|
| 19 |
agent = CodeAgent(
|
| 20 |
model=model,
|
| 21 |
tools=[web_search, visit_webpage, final_answer],
|
|
|
|
| 22 |
max_steps=6,
|
|
|
|
| 23 |
verbosity_level=1,
|
|
|
|
| 24 |
grammar=None,
|
|
|
|
| 25 |
planning_interval=None,
|
|
|
|
| 26 |
name=None,
|
|
|
|
| 27 |
description=None,
|
| 28 |
+
authorized_imports=['math', 'collections', 'random', 'time', 'stat', 're', 'unicodedata', 'pandas', 'queue', 'statistics', 'datetime', 'itertools'],
|
|
|
|
| 29 |
|
| 30 |
prompts_path='./prompts.yaml'
|
| 31 |
)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
|
|
| 1 |
pandas
|
| 2 |
markdownify
|
| 3 |
-
requests
|
| 4 |
smolagents
|
| 5 |
-
|
|
|
|
| 1 |
+
duckduckgo_search
|
| 2 |
pandas
|
| 3 |
markdownify
|
|
|
|
| 4 |
smolagents
|
| 5 |
+
requests
|
tools/visit_webpage.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
|
|
|
| 3 |
import markdownify
|
| 4 |
import requests
|
| 5 |
-
import smolagents
|
| 6 |
|
| 7 |
class VisitWebpageTool(Tool):
|
| 8 |
name = "visit_webpage"
|
|
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
+
import smolagents
|
| 4 |
import markdownify
|
| 5 |
import requests
|
|
|
|
| 6 |
|
| 7 |
class VisitWebpageTool(Tool):
|
| 8 |
name = "visit_webpage"
|