Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,14 +5,17 @@ from transformers import (
|
|
5 |
HfApiEngine,
|
6 |
stream_to_gradio,
|
7 |
)
|
|
|
8 |
|
9 |
# Import tool from Hub
|
10 |
image_generation_tool = load_tool("m-ric/text-to-image")
|
11 |
|
12 |
llm_engine = HfApiEngine("HuggingFaceH4/zephyr-7b-beta")
|
13 |
|
|
|
|
|
14 |
# Initialize the agent with the image generation tool
|
15 |
-
agent = ReactCodeAgent(tools=[], add_base_tools=True, llm_engine=llm_engine, additional_authorized_imports=['requests', 'bs4'])
|
16 |
|
17 |
|
18 |
def interact_with_agent(task):
|
|
|
5 |
HfApiEngine,
|
6 |
stream_to_gradio,
|
7 |
)
|
8 |
+
from transformers.agents.search import DuckDuckGoSearchTool
|
9 |
|
10 |
# Import tool from Hub
|
11 |
image_generation_tool = load_tool("m-ric/text-to-image")
|
12 |
|
13 |
llm_engine = HfApiEngine("HuggingFaceH4/zephyr-7b-beta")
|
14 |
|
15 |
+
search_tool = DuckDuckGoSearchTool()
|
16 |
+
|
17 |
# Initialize the agent with the image generation tool
|
18 |
+
agent = ReactCodeAgent(tools=[search_tool], add_base_tools=True, llm_engine=llm_engine, additional_authorized_imports=['requests', 'bs4'])
|
19 |
|
20 |
|
21 |
def interact_with_agent(task):
|