Spaces:
Running
Running
ffreemt
commited on
Commit
·
2418ebb
1
Parent(s):
d3de7cb
update DuckDuckGoSearchTool
Browse files- app.py +5 -3
- requirements-.txt +53 -0
- requirements.txt +4 -14
app.py
CHANGED
@@ -15,7 +15,8 @@ from smolagents import (
|
|
15 |
HfApiModel,
|
16 |
LiteLLMModel,
|
17 |
Tool,
|
18 |
-
GoogleSearchTool
|
|
|
19 |
)
|
20 |
from smolagents.agent_types import (
|
21 |
AgentAudio,
|
@@ -39,6 +40,7 @@ from scripts.visual_qa import visualizer
|
|
39 |
|
40 |
|
41 |
# web_search = GoogleSearchTool(provider="serper")
|
|
|
42 |
|
43 |
# print(web_search(query="Donald Trump news"))
|
44 |
# TODO fix ValueError: {'message': 'Unauthorized.', 'statusCode': 403}
|
@@ -114,7 +116,7 @@ ti_tool = TextInspectorTool(model, text_limit)
|
|
114 |
browser = SimpleTextBrowser(**BROWSER_CONFIG)
|
115 |
|
116 |
WEB_TOOLS = [
|
117 |
-
|
118 |
VisitTool(browser),
|
119 |
PageUpTool(browser),
|
120 |
PageDownTool(browser),
|
@@ -290,7 +292,7 @@ class GradioUI:
|
|
290 |
|
291 |
However, their agent has a huge downside: it's not open. So we've started a 24-hour rush to replicate and open-source it. Our (Huggingface's) resulting [open-Deep-Research agent](https://github.com/huggingface/smolagents/tree/main/examples/open_deep_research) took the #1 rank of any open submission on the GAIA leaderboard! ✨
|
292 |
|
293 |
-
You can try a simplified version here that uses `Qwen-Coder-32B` (via smolagnet.HfApiModel) instead of `o1`. Modified: if you set MODEL_ID, OPENAI_API_BASE and OPENAI_API_KEY in the .env or env vars (in hf space these can be set in settings, .env will override env vars), the correspoding model will be used. N.B. if you see errors, it might be because whatever quota is exceeded, clone this space and plug in your own resources and run your own deep-research.<br><br>""")
|
294 |
with gr.Group():
|
295 |
gr.Markdown("**Your request**", container=True)
|
296 |
text_input = gr.Textbox(
|
|
|
15 |
HfApiModel,
|
16 |
LiteLLMModel,
|
17 |
Tool,
|
18 |
+
# GoogleSearchTool,
|
19 |
+
DuckDuckGoSearchTool,
|
20 |
)
|
21 |
from smolagents.agent_types import (
|
22 |
AgentAudio,
|
|
|
40 |
|
41 |
|
42 |
# web_search = GoogleSearchTool(provider="serper")
|
43 |
+
web_search = DuckDuckGoSearchTool()
|
44 |
|
45 |
# print(web_search(query="Donald Trump news"))
|
46 |
# TODO fix ValueError: {'message': 'Unauthorized.', 'statusCode': 403}
|
|
|
116 |
browser = SimpleTextBrowser(**BROWSER_CONFIG)
|
117 |
|
118 |
WEB_TOOLS = [
|
119 |
+
web_search, # duckduckgo
|
120 |
VisitTool(browser),
|
121 |
PageUpTool(browser),
|
122 |
PageDownTool(browser),
|
|
|
292 |
|
293 |
However, their agent has a huge downside: it's not open. So we've started a 24-hour rush to replicate and open-source it. Our (Huggingface's) resulting [open-Deep-Research agent](https://github.com/huggingface/smolagents/tree/main/examples/open_deep_research) took the #1 rank of any open submission on the GAIA leaderboard! ✨
|
294 |
|
295 |
+
You can try a simplified version here that uses `Qwen-Coder-32B` (via smolagnet.HfApiModel) instead of `o1`. Modified: if you set MODEL_ID, OPENAI_API_BASE and OPENAI_API_KEY in the .env or env vars (in hf space these can be set in settings, .env will override env vars), the correspoding model will be used. N.B. if you see errors, it might be because whatever quota is exceeded, clone/duplicate this space and plug in your own resources and run your own deep-research.<br><br>""")
|
296 |
with gr.Group():
|
297 |
gr.Markdown("**Your request**", container=True)
|
298 |
text_input = gr.Textbox(
|
requirements-.txt
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# git+https://github.com/huggingface/smolagents.git@main#egg=smolagents
|
2 |
+
smolagents[litellm]
|
3 |
+
|
4 |
+
anthropic>=0.37.1
|
5 |
+
beautifulsoup4>=4.12.3
|
6 |
+
datasets>=2.21.0
|
7 |
+
google_search_results>=2.4.2
|
8 |
+
huggingface_hub>=0.23.4
|
9 |
+
mammoth>=1.8.0
|
10 |
+
markdownify>=0.13.1
|
11 |
+
numexpr>=2.10.1
|
12 |
+
numpy>=2.1.2
|
13 |
+
openai>=1.52.2
|
14 |
+
openpyxl
|
15 |
+
pandas>=2.2.3
|
16 |
+
pathvalidate>=3.2.1
|
17 |
+
|
18 |
+
# pdfminer>=20191125
|
19 |
+
pdfminer.six>=20240706
|
20 |
+
Pillow>=11.0.0
|
21 |
+
puremagic>=1.28
|
22 |
+
pypdf>=5.1.0
|
23 |
+
python-dotenv>=1.0.1
|
24 |
+
python_pptx>=1.0.2
|
25 |
+
Requests>=2.32.3
|
26 |
+
# serpapi>=0.1.5
|
27 |
+
serpapi
|
28 |
+
|
29 |
+
google-search-results
|
30 |
+
tqdm>=4.66.4
|
31 |
+
torch>=2.2.2
|
32 |
+
torchvision>=0.17.2
|
33 |
+
transformers>=4.46.0
|
34 |
+
youtube_transcript_api>=0.6.2
|
35 |
+
chess
|
36 |
+
sympy
|
37 |
+
pubchempy
|
38 |
+
Bio
|
39 |
+
scikit-learn
|
40 |
+
scipy
|
41 |
+
pydub
|
42 |
+
PyPDF2
|
43 |
+
python-pptx
|
44 |
+
torch
|
45 |
+
xlrd
|
46 |
+
SpeechRecognition
|
47 |
+
litellm
|
48 |
+
|
49 |
+
google-api-python-client
|
50 |
+
google-auth-httplib2
|
51 |
+
google-auth-oauthlib
|
52 |
+
gradio
|
53 |
+
loguru
|
requirements.txt
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
-
|
2 |
-
smolagents[litellm]
|
3 |
-
|
4 |
anthropic>=0.37.1
|
5 |
beautifulsoup4>=4.12.3
|
6 |
datasets>=2.21.0
|
@@ -14,8 +12,7 @@ openai>=1.52.2
|
|
14 |
openpyxl
|
15 |
pandas>=2.2.3
|
16 |
pathvalidate>=3.2.1
|
17 |
-
|
18 |
-
# pdfminer>=20191125
|
19 |
pdfminer.six>=20240706
|
20 |
Pillow>=11.0.0
|
21 |
puremagic>=1.28
|
@@ -23,10 +20,7 @@ pypdf>=5.1.0
|
|
23 |
python-dotenv>=1.0.1
|
24 |
python_pptx>=1.0.2
|
25 |
Requests>=2.32.3
|
26 |
-
|
27 |
-
serpapi
|
28 |
-
|
29 |
-
google-search-results
|
30 |
tqdm>=4.66.4
|
31 |
torch>=2.2.2
|
32 |
torchvision>=0.17.2
|
@@ -46,8 +40,4 @@ xlrd
|
|
46 |
SpeechRecognition
|
47 |
litellm
|
48 |
|
49 |
-
|
50 |
-
google-auth-httplib2
|
51 |
-
google-auth-oauthlib
|
52 |
-
gradio
|
53 |
-
loguru
|
|
|
1 |
+
smolagents==1.14.0
|
|
|
|
|
2 |
anthropic>=0.37.1
|
3 |
beautifulsoup4>=4.12.3
|
4 |
datasets>=2.21.0
|
|
|
12 |
openpyxl
|
13 |
pandas>=2.2.3
|
14 |
pathvalidate>=3.2.1
|
15 |
+
pdfminer>=20191125
|
|
|
16 |
pdfminer.six>=20240706
|
17 |
Pillow>=11.0.0
|
18 |
puremagic>=1.28
|
|
|
20 |
python-dotenv>=1.0.1
|
21 |
python_pptx>=1.0.2
|
22 |
Requests>=2.32.3
|
23 |
+
serpapi>=0.1.5
|
|
|
|
|
|
|
24 |
tqdm>=4.66.4
|
25 |
torch>=2.2.2
|
26 |
torchvision>=0.17.2
|
|
|
40 |
SpeechRecognition
|
41 |
litellm
|
42 |
|
43 |
+
duckduckgo-search
|
|
|
|
|
|
|
|