Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,9 +107,14 @@ def generate_object_history(object_name):
|
|
| 107 |
from smolagents.tools import Tool, load_tool
|
| 108 |
image_generation_tool = load_tool("m-ric/text-to-image", cache=False, trust_remote_code=True)
|
| 109 |
|
|
|
|
| 110 |
class WrappedTextToImageTool(Tool):
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
image_generation_tool = WrappedTextToImageTool()
|
| 115 |
|
|
|
|
| 107 |
from smolagents.tools import Tool, load_tool
|
| 108 |
image_generation_tool = load_tool("m-ric/text-to-image", cache=False, trust_remote_code=True)
|
| 109 |
|
| 110 |
+
|
| 111 |
class WrappedTextToImageTool(Tool):
|
| 112 |
+
name = "text_to_image"
|
| 113 |
+
description = "Generates an image from a text prompt using the m-ric/text-to-image tool."
|
| 114 |
+
inputs = ["prompt"] # Optional: only if smolagents uses this
|
| 115 |
+
|
| 116 |
+
def run(self, prompt: str) -> str:
|
| 117 |
+
return image_generation_tool(prompt)
|
| 118 |
|
| 119 |
image_generation_tool = WrappedTextToImageTool()
|
| 120 |
|