Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,13 @@ model = OpenAIServerModel(
|
|
51 |
)
|
52 |
|
53 |
# Import tool from Hub
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
with open("prompts.yaml", 'r') as stream:
|
57 |
prompt_templates = yaml.safe_load(stream)
|
|
|
51 |
)
|
52 |
|
53 |
# Import tool from Hub
|
54 |
+
HF_API_KEY = os.getenv("HF_TOKEN") # 🔒 Recuperiamo il token dai secrets
|
55 |
+
|
56 |
+
image_generation_tool = load_tool(
|
57 |
+
"agents-course/text-to-image",
|
58 |
+
trust_remote_code=True,
|
59 |
+
token=HF_API_KEY # ✅ Passiamo il token per autenticare le richieste
|
60 |
+
)
|
61 |
|
62 |
with open("prompts.yaml", 'r') as stream:
|
63 |
prompt_templates = yaml.safe_load(stream)
|