simonpc commited on
Commit
bc878de
·
verified ·
1 Parent(s): 65f9f07

using only image generator tool & import from hub

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -44,20 +44,19 @@ model = HfApiModel(
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
- output_type = "image"
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, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove 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,