Spaces:
Sleeping
Sleeping
PolPC13 commited on
Commit ·
720b4df
1
Parent(s): 9c3ecce
Removed query image tool.
Browse files- app.py +2 -5
- tools/new_tools.py +1 -11
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from tools.exchange_rates import ExchangeRatesTool
|
|
| 8 |
from tools.web_search import ddgs
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
-
from tools.new_tools import
|
| 12 |
from tools.get_current_time import GetCurrentTimeTool
|
| 13 |
|
| 14 |
final_answer = FinalAnswerTool()
|
|
@@ -24,15 +24,12 @@ custom_role_conversions=None,
|
|
| 24 |
)
|
| 25 |
|
| 26 |
|
| 27 |
-
# Import tool from Hub
|
| 28 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 29 |
-
|
| 30 |
with open("prompts.yaml", 'r') as stream:
|
| 31 |
prompt_templates = yaml.safe_load(stream)
|
| 32 |
|
| 33 |
agent = CodeAgent(
|
| 34 |
model=model,
|
| 35 |
-
tools=[final_answer, ddgs(), VisitWebpageTool(), ExchangeRatesTool(), WikiSearchTool, ReverseStringTool(), GetCurrentTimeTool()], ## add your tools here (don't remove final answer)
|
| 36 |
max_steps=6,
|
| 37 |
verbosity_level=1,
|
| 38 |
grammar=None,
|
|
|
|
| 8 |
from tools.web_search import ddgs
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
+
from tools.new_tools import ReverseStringTool, WikiSearchTool
|
| 12 |
from tools.get_current_time import GetCurrentTimeTool
|
| 13 |
|
| 14 |
final_answer = FinalAnswerTool()
|
|
|
|
| 24 |
)
|
| 25 |
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
with open("prompts.yaml", 'r') as stream:
|
| 28 |
prompt_templates = yaml.safe_load(stream)
|
| 29 |
|
| 30 |
agent = CodeAgent(
|
| 31 |
model=model,
|
| 32 |
+
tools=[final_answer, ddgs(), VisitWebpageTool(), ExchangeRatesTool(), WikiSearchTool(), ReverseStringTool(), GetCurrentTimeTool()], ## add your tools here (don't remove final answer)
|
| 33 |
max_steps=6,
|
| 34 |
verbosity_level=1,
|
| 35 |
grammar=None,
|
tools/new_tools.py
CHANGED
|
@@ -2,17 +2,7 @@ from smolagents import Tool
|
|
| 2 |
from transformers import AutoProcessor
|
| 3 |
# adjust import to your setup
|
| 4 |
# from langchain_community.retrievers import WikipediaRetriever # or your existing retriever
|
| 5 |
-
|
| 6 |
-
import torch
|
| 7 |
-
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
|
| 8 |
-
from qwen_vl_utils import process_vision_info
|
| 9 |
-
HAS_VISION_DEPS = True
|
| 10 |
-
except Exception:
|
| 11 |
-
torch = None
|
| 12 |
-
AutoProcessor = None
|
| 13 |
-
Qwen2_5_VLForConditionalGeneration = None
|
| 14 |
-
process_vision_info = None
|
| 15 |
-
HAS_VISION_DEPS = False
|
| 16 |
|
| 17 |
class WikiSearchTool(Tool):
|
| 18 |
name = "wiki_search"
|
|
|
|
| 2 |
from transformers import AutoProcessor
|
| 3 |
# adjust import to your setup
|
| 4 |
# from langchain_community.retrievers import WikipediaRetriever # or your existing retriever
|
| 5 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
class WikiSearchTool(Tool):
|
| 8 |
name = "wiki_search"
|