Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
|
| 11 |
@tool
|
| 12 |
def my_custom_tool(query: str, max_results: int = 3) -> list[str]:
|
| 13 |
"""
|
|
@@ -31,8 +31,9 @@ def generate_images(prompt: str, n: int = 3) -> list[str]:
|
|
| 31 |
Returns:
|
| 32 |
A list of image asset IDs.
|
| 33 |
"""
|
| 34 |
-
image_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 35 |
-
return image_tool.run(prompt, max_results=n)
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 11 |
@tool
|
| 12 |
def my_custom_tool(query: str, max_results: int = 3) -> list[str]:
|
| 13 |
"""
|
|
|
|
| 31 |
Returns:
|
| 32 |
A list of image asset IDs.
|
| 33 |
"""
|
| 34 |
+
#image_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 35 |
+
#return image_tool.run(prompt, max_results=n)
|
| 36 |
+
return image_generation_tool.run(prompt, max_results=n)
|
| 37 |
|
| 38 |
|
| 39 |
|