Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ from scripts.text_web_browser import (
|
|
| 32 |
SimpleTextBrowser,
|
| 33 |
VisitTool,
|
| 34 |
)
|
| 35 |
-
from scripts.visual_qa import
|
| 36 |
from tqdm import tqdm
|
| 37 |
|
| 38 |
from smolagents import (
|
|
@@ -252,12 +252,14 @@ WEB_TOOLS = [
|
|
| 252 |
TextInspectorTool(model, text_limit),
|
| 253 |
]
|
| 254 |
|
|
|
|
|
|
|
| 255 |
# Agent creation in a factory function
|
| 256 |
def create_agent():
|
| 257 |
"""Creates a fresh agent instance for each session"""
|
| 258 |
return CodeAgent(
|
| 259 |
model=model,
|
| 260 |
-
tools=[
|
| 261 |
max_steps=15,
|
| 262 |
verbosity_level=1,
|
| 263 |
additional_authorized_imports=AUTHORIZED_IMPORTS,
|
|
|
|
| 32 |
SimpleTextBrowser,
|
| 33 |
VisitTool,
|
| 34 |
)
|
| 35 |
+
from scripts.visual_qa import VisualQATool
|
| 36 |
from tqdm import tqdm
|
| 37 |
|
| 38 |
from smolagents import (
|
|
|
|
| 252 |
TextInspectorTool(model, text_limit),
|
| 253 |
]
|
| 254 |
|
| 255 |
+
visual_qa_tool = VisualQATool()
|
| 256 |
+
|
| 257 |
# Agent creation in a factory function
|
| 258 |
def create_agent():
|
| 259 |
"""Creates a fresh agent instance for each session"""
|
| 260 |
return CodeAgent(
|
| 261 |
model=model,
|
| 262 |
+
tools=[visual_qa_tool, image_generation_tool] + WEB_TOOLS,
|
| 263 |
max_steps=15,
|
| 264 |
verbosity_level=1,
|
| 265 |
additional_authorized_imports=AUTHORIZED_IMPORTS,
|