Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import datetime
|
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
|
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
@@ -53,8 +54,15 @@ custom_role_conversions=None,
|
|
53 |
)
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
# Import tool from Hub
|
57 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
58 |
|
59 |
with open("prompts.yaml", 'r') as stream:
|
60 |
prompt_templates = yaml.safe_load(stream)
|
|
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
+
from huggingface_hub import login
|
7 |
from tools.final_answer import FinalAnswerTool
|
8 |
|
9 |
from Gradio_UI import GradioUI
|
|
|
54 |
)
|
55 |
|
56 |
|
57 |
+
# Carga el tool oficial de text-to-image
|
58 |
+
image_generation_tool = load_tool(
|
59 |
+
"huggingface-tools/text-to-image", # Nombre oficial
|
60 |
+
model="stabilityai/stable-diffusion-xl-base-1.0", # Modelo específico
|
61 |
+
trust_remote_code=True
|
62 |
+
)
|
63 |
+
|
64 |
# Import tool from Hub
|
65 |
+
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
66 |
|
67 |
with open("prompts.yaml", 'r') as stream:
|
68 |
prompt_templates = yaml.safe_load(stream)
|