Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from huggingface_hub import InferenceClient
|
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
from gradio_client import Client
|
| 9 |
import os
|
|
|
|
| 10 |
|
| 11 |
#client = Client("owner/space_name", hf_token=os.environ.get("HF_TOKEN"))
|
| 12 |
#result = client.predict("Astronaut riding a horse", api_name="/predict")
|
|
@@ -18,9 +19,13 @@ from Gradio_UI import GradioUI
|
|
| 18 |
@tool
|
| 19 |
def inference_image_tool(prompt: str, model: str = "black-forest-labs/FLUX.1-dev") -> str:
|
| 20 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 21 |
-
"""Generate an image from a text prompt using Hugging Face Inference Providers.
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
model: HF model id (e.g. black-forest-labs/FLUX.1-dev).
|
| 25 |
"""
|
| 26 |
token = os.getenv("HF_TOKEN")
|
|
|
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
from gradio_client import Client
|
| 9 |
import os
|
| 10 |
+
import uuid
|
| 11 |
|
| 12 |
#client = Client("owner/space_name", hf_token=os.environ.get("HF_TOKEN"))
|
| 13 |
#result = client.predict("Astronaut riding a horse", api_name="/predict")
|
|
|
|
| 19 |
@tool
|
| 20 |
def inference_image_tool(prompt: str, model: str = "black-forest-labs/FLUX.1-dev") -> str:
|
| 21 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 22 |
+
"""Generate an image from a text prompt using Hugging Face Inference Providers.
|
| 23 |
+
|
| 24 |
+
Returns:
|
| 25 |
+
A local file path to a PNG image.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
prompt: Text prompt for the image.
|
| 29 |
model: HF model id (e.g. black-forest-labs/FLUX.1-dev).
|
| 30 |
"""
|
| 31 |
token = os.getenv("HF_TOKEN")
|