Spaces:
Sleeping
Sleeping
using only image generator tool & import from hub
Browse files
app.py
CHANGED
@@ -44,20 +44,19 @@ model = HfApiModel(
|
|
44 |
)
|
45 |
|
46 |
# Import tool from Hub
|
47 |
-
|
48 |
-
image_generation_tool = Tool.from_space(
|
49 |
-
"black-forest-labs/FLUX.1-schnell",
|
50 |
-
name="image_generator",
|
51 |
-
description="This tool creates an image according to a prompt, which is a text description."
|
52 |
-
|
53 |
-
)
|
54 |
|
55 |
with open("prompts.yaml", 'r') as stream:
|
56 |
prompt_templates = yaml.safe_load(stream)
|
57 |
|
58 |
agent = CodeAgent(
|
59 |
model=model,
|
60 |
-
tools=[final_answer,
|
61 |
max_steps=6,
|
62 |
verbosity_level=1,
|
63 |
grammar=None,
|
|
|
44 |
)
|
45 |
|
46 |
# Import tool from Hub
|
47 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
48 |
+
#image_generation_tool = Tool.from_space(
|
49 |
+
# "black-forest-labs/FLUX.1-schnell",
|
50 |
+
# name="image_generator",
|
51 |
+
# description="This tool creates an image according to a prompt, which is a text description."
|
52 |
+
#)
|
|
|
53 |
|
54 |
with open("prompts.yaml", 'r') as stream:
|
55 |
prompt_templates = yaml.safe_load(stream)
|
56 |
|
57 |
agent = CodeAgent(
|
58 |
model=model,
|
59 |
+
tools=[final_answer, image_generation_tool], ## add your tools here (don't remove final answer)
|
60 |
max_steps=6,
|
61 |
verbosity_level=1,
|
62 |
grammar=None,
|