Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, Tool, tool, VisitWebpageTool
|
| 7 |
-
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
@@ -103,7 +103,6 @@ class BasicAgent:
|
|
| 103 |
"matterattetatte/pdf-upload-extractor-tool",
|
| 104 |
trust_remote_code = True
|
| 105 |
)
|
| 106 |
-
modified_system_message = CODE_SYSTEM_PROMPT + "If the question includes a task_id and mentions a file, call fetch_task_file first; route YouTube URLs to get_youtube_transcript, other URLs to visit_webpage, PDFs to pdf_tool, and spreadsheets to read_spreadsheet, using web_search only when no URL or file is given,then respond with only the exact final answer value, no explanation, no prefix."
|
| 107 |
self.agent = CodeAgent(
|
| 108 |
tools=[
|
| 109 |
DuckDuckGoSearchTool(),
|
|
@@ -114,9 +113,9 @@ class BasicAgent:
|
|
| 114 |
get_youtube_transcript,
|
| 115 |
#os.environ["HF_TOKEN"] = "hf_token",
|
| 116 |
#image_analysis_tool,
|
| 117 |
-
|
| 118 |
-
],
|
| 119 |
model=InferenceClientModel("Qwen/Qwen2.5-Coder-32B-Instruct"),
|
|
|
|
| 120 |
max_steps=20,
|
| 121 |
)
|
| 122 |
#answering questions
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, Tool, tool, VisitWebpageTool
|
| 7 |
+
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
|
|
| 103 |
"matterattetatte/pdf-upload-extractor-tool",
|
| 104 |
trust_remote_code = True
|
| 105 |
)
|
|
|
|
| 106 |
self.agent = CodeAgent(
|
| 107 |
tools=[
|
| 108 |
DuckDuckGoSearchTool(),
|
|
|
|
| 113 |
get_youtube_transcript,
|
| 114 |
#os.environ["HF_TOKEN"] = "hf_token",
|
| 115 |
#image_analysis_tool,
|
| 116 |
+
],
|
|
|
|
| 117 |
model=InferenceClientModel("Qwen/Qwen2.5-Coder-32B-Instruct"),
|
| 118 |
+
instructions = "If the question includes a task_id and mentions a file, call fetch_task_file first; route YouTube URLs to get_youtube_transcript, other URLs to visit_webpage, PDFs to pdf_tool, and spreadsheets to read_spreadsheet, using web_search only when no URL or file is given,then respond with only the exact final answer value, no explanation, no prefix."
|
| 119 |
max_steps=20,
|
| 120 |
)
|
| 121 |
#answering questions
|