hardknee commited on
Commit
d69f858
·
verified ·
1 Parent(s): 60363a4

Update app.py

Browse files

Try using PIL library to define Image

Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
 
7
 
8
  from Gradio_UI import GradioUI
9
 
@@ -51,7 +52,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
51
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
52
 
53
  @tool
54
- def generate_image(description: str):
55
  """A tool that generates an image from a text description.
56
  Args:
57
  description: A string representing the text description to generate an image of.
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
+ from PIL import Image
8
 
9
  from Gradio_UI import GradioUI
10
 
 
52
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
53
 
54
  @tool
55
+ def generate_image(description: str) -> Image:
56
  """A tool that generates an image from a text description.
57
  Args:
58
  description: A string representing the text description to generate an image of.