Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,14 +20,15 @@ def my_custom_tool(arg1:str, img: bool)-> Any: #it's import to specify the retur
|
|
| 20 |
"""A tool that uses 'DuckDuckGoSearchTool' tool to answer any query and 'image_generation_tool' tool to generate image.
|
| 21 |
Args:
|
| 22 |
arg1: string query to be used to search answer via given search tool.
|
| 23 |
-
img: boolean value in TRUE/FALSE if TRUE then
|
| 24 |
"""
|
| 25 |
try:
|
| 26 |
if img:
|
| 27 |
return
|
| 28 |
# Import tool from Hub
|
| 29 |
#image_generation_tool = load_tool("dwb2023/text-to-image", trust_remote_code=True)
|
| 30 |
-
|
|
|
|
| 31 |
#launch_gradio_demo(image_generation_tool(arg1))
|
| 32 |
else:
|
| 33 |
search_obj = DuckDuckGoSearchTool()
|
|
|
|
| 20 |
"""A tool that uses 'DuckDuckGoSearchTool' tool to answer any query and 'image_generation_tool' tool to generate image.
|
| 21 |
Args:
|
| 22 |
arg1: string query to be used to search answer via given search tool.
|
| 23 |
+
img: boolean value in TRUE/FALSE if TRUE then arg1 as prompt for generating image.
|
| 24 |
"""
|
| 25 |
try:
|
| 26 |
if img:
|
| 27 |
return
|
| 28 |
# Import tool from Hub
|
| 29 |
#image_generation_tool = load_tool("dwb2023/text-to-image", trust_remote_code=True)
|
| 30 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 31 |
+
return image_generation_tool(arg1)
|
| 32 |
#launch_gradio_demo(image_generation_tool(arg1))
|
| 33 |
else:
|
| 34 |
search_obj = DuckDuckGoSearchTool()
|