Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import torch
|
|
13 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig
|
14 |
from smolagents import CodeAgent, VisitWebpageTool, PromptTemplates, PlanningPromptTemplate, ManagedAgentPromptTemplate, FinalAnswerPromptTemplate
|
15 |
from smolagents.models import ChatMessage
|
16 |
-
from custom_tools import WebpageStructureAnalyzerTool, SummarizeWebpageContentTool, ExtractTableFromWebpageTool, GetWikipediaSectionTool, ReadCodeFromURLTool, CachedWebSearchTool, CachedWikiTool, PreloadedPythonTool
|
17 |
|
18 |
subprocess.run(["playwright", "install"], check=True)
|
19 |
|
@@ -177,6 +177,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
177 |
table_extractor_tool = ExtractTableFromWebpageTool()
|
178 |
get_wiki_section_tool = GetWikipediaSectionTool()
|
179 |
url_code_reader_tool = ReadCodeFromURLTool()
|
|
|
|
|
180 |
wiki_tool = CachedWikiTool()
|
181 |
search_tool = CachedWebSearchTool()
|
182 |
python_tool = PreloadedPythonTool()
|
@@ -198,7 +200,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
198 |
post_messages=data['final_answer']['post_messages']))
|
199 |
# (5) Create the CodeAgent, passing the LLM wrapper and tools
|
200 |
agent = CodeAgent(model=llm_model,
|
201 |
-
tools=[web_structure_analyzer_tool, summarizer_tool, table_extractor_tool, get_wiki_section_tool, url_code_reader_tool, wiki_tool, search_tool, python_tool, html_parse_tool],
|
202 |
prompt_templates=my_prompt_templates,
|
203 |
max_steps=8,
|
204 |
add_base_tools=True,
|
|
|
13 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig
|
14 |
from smolagents import CodeAgent, VisitWebpageTool, PromptTemplates, PlanningPromptTemplate, ManagedAgentPromptTemplate, FinalAnswerPromptTemplate
|
15 |
from smolagents.models import ChatMessage
|
16 |
+
from custom_tools import WebpageStructureAnalyzerTool, SummarizeWebpageContentTool, ExtractTableFromWebpageTool, GetWikipediaSectionTool, ReadCodeFromURLTool, ImageContentDescriberTool, TranscribeAudioTool, CachedWebSearchTool, CachedWikiTool, PreloadedPythonTool
|
17 |
|
18 |
subprocess.run(["playwright", "install"], check=True)
|
19 |
|
|
|
177 |
table_extractor_tool = ExtractTableFromWebpageTool()
|
178 |
get_wiki_section_tool = GetWikipediaSectionTool()
|
179 |
url_code_reader_tool = ReadCodeFromURLTool()
|
180 |
+
image_content_describer_tool = ImageContentDescriberTool()
|
181 |
+
audio_transcriber_tool = TranscribeAudioTool()
|
182 |
wiki_tool = CachedWikiTool()
|
183 |
search_tool = CachedWebSearchTool()
|
184 |
python_tool = PreloadedPythonTool()
|
|
|
200 |
post_messages=data['final_answer']['post_messages']))
|
201 |
# (5) Create the CodeAgent, passing the LLM wrapper and tools
|
202 |
agent = CodeAgent(model=llm_model,
|
203 |
+
tools=[web_structure_analyzer_tool, summarizer_tool, table_extractor_tool, get_wiki_section_tool, image_content_describer_tool, audio_transcriber_tool, url_code_reader_tool, wiki_tool, search_tool, python_tool, html_parse_tool],
|
204 |
prompt_templates=my_prompt_templates,
|
205 |
max_steps=8,
|
206 |
add_base_tools=True,
|