m-ric HF staff commited on
Commit
a379d16
·
1 Parent(s): e76df21

Improve description

Browse files
Files changed (2) hide show
  1. app.py +13 -25
  2. requirements.txt +2 -1
app.py CHANGED
@@ -40,6 +40,7 @@ from smolagents import (
40
  Model,
41
  ToolCallingAgent,
42
  )
 
43
  from smolagents.gradio_ui import pull_messages_from_step, handle_agent_output_types
44
 
45
 
@@ -130,34 +131,14 @@ WEB_TOOLS = [
130
  ArchiveSearchTool(browser),
131
  TextInspectorTool(model, text_limit),
132
  ]
133
- text_webbrowser_agent = ToolCallingAgent(
134
- model=model,
135
- tools=WEB_TOOLS,
136
- max_steps=20,
137
- verbosity_level=2,
138
- planning_interval=4,
139
- name="search_agent",
140
- description="""A team member that will search the internet to answer your question.
141
- Ask him for all your questions that require browsing the web.
142
- Provide him as much context as possible, in particular if you need to search on a specific timeframe!
143
- And don't hesitate to provide him with a complex search task, like finding a difference between two webpages.
144
- Your request must be a real sentence, not a google search! Like "Find me this information (...)" rather than a few keywords.
145
- """,
146
- provide_run_summary=True,
147
- managed_agent_prompt=MANAGED_AGENT_PROMPT
148
- + """You can navigate to .txt online files.
149
- If a non-html page is in another format, especially .pdf or a Youtube video, use tool 'inspect_file_as_text' to inspect it.
150
- Additionally, if after some searching you find out that you need more information to answer the question, you can use `final_answer` with your request for clarification as argument to request for more information.""",
151
- )
152
 
153
  agent = CodeAgent(
154
  model=model,
155
- tools=[visualizer, ti_tool],
156
- max_steps=12,
157
  verbosity_level=2,
158
  additional_authorized_imports=AUTHORIZED_IMPORTS,
159
  planning_interval=4,
160
- managed_agents=[text_webbrowser_agent],
161
  )
162
 
163
  document_inspection_tool = TextInspectorTool(model, 20000)
@@ -291,11 +272,18 @@ class GradioUI:
291
  )
292
 
293
  def launch(self, **kwargs):
294
- with gr.Blocks(fill_height=True) as demo:
 
 
 
 
 
 
 
295
  stored_messages = gr.State([])
296
  file_uploads_log = gr.State([])
297
  chatbot = gr.Chatbot(
298
- label="Agent",
299
  type="messages",
300
  avatar_images=(
301
  None,
@@ -313,7 +301,7 @@ class GradioUI:
313
  [upload_file, file_uploads_log],
314
  [upload_status, file_uploads_log],
315
  )
316
- text_input = gr.Textbox(lines=1, label="Chat Message")
317
  text_input.submit(
318
  self.log_user_message,
319
  [text_input, file_uploads_log],
 
40
  Model,
41
  ToolCallingAgent,
42
  )
43
+ from smolagents.agent_types import AgentText, AgentImage, AgentAudio
44
  from smolagents.gradio_ui import pull_messages_from_step, handle_agent_output_types
45
 
46
 
 
131
  ArchiveSearchTool(browser),
132
  TextInspectorTool(model, text_limit),
133
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  agent = CodeAgent(
136
  model=model,
137
+ tools=[visualizer] + WEB_TOOLS,
138
+ max_steps=5,
139
  verbosity_level=2,
140
  additional_authorized_imports=AUTHORIZED_IMPORTS,
141
  planning_interval=4,
 
142
  )
143
 
144
  document_inspection_tool = TextInspectorTool(model, 20000)
 
272
  )
273
 
274
  def launch(self, **kwargs):
275
+ with gr.Blocks(theme="ocean", fill_height=True) as demo:
276
+ gr.Markdown("""# open Deep Research - free the AI agents!
277
+
278
+ OpenAI just published [Deep Research](https://openai.com/index/introducing-deep-research/), a very nice assistant that can perform deep searches in file or the web to answer user requests.
279
+
280
+ 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 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! ✨
281
+
282
+ You can try a simplified version below. 👇""")
283
  stored_messages = gr.State([])
284
  file_uploads_log = gr.State([])
285
  chatbot = gr.Chatbot(
286
+ label="open-Deep-Research",
287
  type="messages",
288
  avatar_images=(
289
  None,
 
301
  [upload_file, file_uploads_log],
302
  [upload_status, file_uploads_log],
303
  )
304
+ text_input = gr.Textbox(lines=1, label="Your request")
305
  text_input.submit(
306
  self.log_user_message,
307
  [text_input, file_uploads_log],
requirements.txt CHANGED
@@ -37,4 +37,5 @@ PyPDF2
37
  python-pptx
38
  torch
39
  xlrd
40
- SpeechRecognition
 
 
37
  python-pptx
38
  torch
39
  xlrd
40
+ SpeechRecognition
41
+ litellm