abidlabs HF staff commited on
Commit
498886f
·
verified ·
1 Parent(s): 09efd14

Update tool.py

Browse files
Files changed (1) hide show
  1. tool.py +2 -1
tool.py CHANGED
@@ -1,5 +1,6 @@
1
  from smolagents import Tool
2
  from huggingface_hub import InferenceClient
 
3
 
4
 
5
  class TextToImageTool(Tool):
@@ -8,7 +9,7 @@ class TextToImageTool(Tool):
8
  inputs = {"prompt": {"type": "string", "description": "The image generator prompt. Don't hesitate to add details in the prompt to make the image look better, like 'high-res, photorealistic', etc."}}
9
  output_type = "image"
10
  model_sdxl = "black-forest-labs/FLUX.1-schnell"
11
- client = InferenceClient(model_sdxl)
12
 
13
 
14
  def forward(self, prompt):
 
1
  from smolagents import Tool
2
  from huggingface_hub import InferenceClient
3
+ import os
4
 
5
 
6
  class TextToImageTool(Tool):
 
9
  inputs = {"prompt": {"type": "string", "description": "The image generator prompt. Don't hesitate to add details in the prompt to make the image look better, like 'high-res, photorealistic', etc."}}
10
  output_type = "image"
11
  model_sdxl = "black-forest-labs/FLUX.1-schnell"
12
+ client = InferenceClient(model_sdxl, token=os.environ["HF_TOKEN"])
13
 
14
 
15
  def forward(self, prompt):