lpolich commited on
Commit
19c8232
·
verified ·
1 Parent(s): 9e42dc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -23,18 +23,18 @@ 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)-> str: #it's import to specify the return type
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:
30
  img_description: a sting containing the description of the image the user wants to get
31
  """
32
- client = Client("agents-course/text-to-image")
33
- result = client.predict(
34
- param_0="Hello!!",
35
- api_name="/predict"
36
- )
37
- return result
38
  # -- my tool end
39
 
40
 
 
23
  return "What magic will you build ?"
24
  # -- my tool
25
  @tool
26
+ def get_image(img_description:str)-> 'image': #it's import to specify the return type
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:
30
  img_description: a sting containing the description of the image the user wants to get
31
  """
32
+ # client = Client("agents-course/text-to-image")
33
+ # result = client.predict(
34
+ # param_0="Hello!!",
35
+ # api_name="/predict"
36
+ # )
37
+ return image_generation_tool.forward(img_description)
38
  # -- my tool end
39
 
40