Spaces:
Sleeping
Sleeping
Andrey
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -46,7 +46,14 @@ custom_role_conversions=None,
|
|
| 46 |
|
| 47 |
|
| 48 |
# Import tool from Hub
|
| 49 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
with open("prompts.yaml", 'r') as stream:
|
| 52 |
prompt_templates = yaml.safe_load(stream)
|
|
|
|
| 1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool,Tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
# Import tool from Hub
|
| 49 |
+
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 50 |
+
|
| 51 |
+
image_generation_tool = Tool.from_space(
|
| 52 |
+
"black-forest-labs/FLUX.1-schnell",
|
| 53 |
+
name="image_generator",
|
| 54 |
+
description="Generate an image from a prompt"
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
|
| 58 |
with open("prompts.yaml", 'r') as stream:
|
| 59 |
prompt_templates = yaml.safe_load(stream)
|