Spaces:
Sleeping
Sleeping
Update tool.py
Browse files
tool.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
from smolagents import Tool
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
|
@@ -8,7 +10,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 |
+
import os
|
| 2 |
+
|
| 3 |
from smolagents import Tool
|
| 4 |
from huggingface_hub import InferenceClient
|
| 5 |
|
|
|
|
| 10 |
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."}}
|
| 11 |
output_type = "image"
|
| 12 |
model_sdxl = "black-forest-labs/FLUX.1-schnell"
|
| 13 |
+
client = InferenceClient(model_sdxl, token=os.environ["HF_TOKEN"])
|
| 14 |
|
| 15 |
|
| 16 |
def forward(self, prompt):
|