Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,8 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
from gradio_client import Client
|
| 10 |
|
|
|
|
|
|
|
| 11 |
# Import tool from Hub
|
| 12 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 13 |
|
|
@@ -23,7 +25,7 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 23 |
return "What magic will you build ?"
|
| 24 |
# -- my tool
|
| 25 |
@tool
|
| 26 |
-
def get_image(img_description:str) ->
|
| 27 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 28 |
"""A tool that generate an image from a textual description
|
| 29 |
Args:
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
from gradio_client import Client
|
| 10 |
|
| 11 |
+
from PIL import Image
|
| 12 |
+
|
| 13 |
# Import tool from Hub
|
| 14 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 15 |
|
|
|
|
| 25 |
return "What magic will you build ?"
|
| 26 |
# -- my tool
|
| 27 |
@tool
|
| 28 |
+
def get_image(img_description:str) -> Image.Image: #it's import to specify the return type
|
| 29 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 30 |
"""A tool that generate an image from a textual description
|
| 31 |
Args:
|