abdullahfurquan commited on
Commit
6b98fd7
·
verified ·
1 Parent(s): 622dd06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
  import os
 
8
 
9
  from Gradio_UI import GradioUI
10
 
@@ -17,14 +18,14 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
17
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
18
 
19
  @tool
20
- def generate_image_tool(prompt: str) -> str:
21
  """Generates an image from text using the image generation tool.
22
 
23
  Args:
24
  prompt: A description of the image to generate.
25
 
26
  Returns:
27
- The generated image URL or path.
28
  """
29
  try:
30
  return image_generation_tool(prompt)
 
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
  import os
8
+ from PIL import Image
9
 
10
  from Gradio_UI import GradioUI
11
 
 
18
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
19
 
20
  @tool
21
+ def generate_image_tool(prompt: str) -> Image:
22
  """Generates an image from text using the image generation tool.
23
 
24
  Args:
25
  prompt: A description of the image to generate.
26
 
27
  Returns:
28
+ The generated image.
29
  """
30
  try:
31
  return image_generation_tool(prompt)