Spaces:
Runtime error
Runtime error
Update app.py
Browse filesadding new tool
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from bs4 import BeautifulSoup
|
|
| 11 |
import json
|
| 12 |
#from huggingface_hub import InferenceClient
|
| 13 |
#from PIL import Image
|
|
|
|
| 14 |
|
| 15 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 16 |
@tool
|
|
@@ -30,6 +31,12 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 30 |
# #image.save("corgi_superhero.png")
|
| 31 |
# return image
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
@tool
|
| 34 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 35 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 11 |
import json
|
| 12 |
#from huggingface_hub import InferenceClient
|
| 13 |
#from PIL import Image
|
| 14 |
+
from smolagents import Tool
|
| 15 |
|
| 16 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 17 |
@tool
|
|
|
|
| 31 |
# #image.save("corgi_superhero.png")
|
| 32 |
# return image
|
| 33 |
|
| 34 |
+
my_image_tool = Tool.from_space(
|
| 35 |
+
"black-forest-labs/FLUX.1-schnell",
|
| 36 |
+
name="image_generator",
|
| 37 |
+
description="Generate an image from a prompt"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
@tool
|
| 41 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 42 |
"""A tool that fetches the current local time in a specified timezone.
|