Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,10 @@ from gradio_client import Client
|
|
| 7 |
class TextToImageTool(Tool):
|
| 8 |
name = "text_to_image"
|
| 9 |
description = "Generate an image from a text prompt using m-ric/text-to-image."
|
| 10 |
-
|
| 11 |
inputs = {
|
| 12 |
"prompt": {
|
| 13 |
-
"type": "
|
| 14 |
"description": "Text prompt to generate the image"
|
| 15 |
}
|
| 16 |
}
|
|
@@ -21,7 +21,7 @@ class TextToImageTool(Tool):
|
|
| 21 |
super().__init__()
|
| 22 |
self.client = Client("m-ric/text-to-image")
|
| 23 |
|
| 24 |
-
def run(self, prompt):
|
| 25 |
return self.client.predict(prompt, api_name="/predict")
|
| 26 |
|
| 27 |
#%% Utility functions
|
|
|
|
| 7 |
class TextToImageTool(Tool):
|
| 8 |
name = "text_to_image"
|
| 9 |
description = "Generate an image from a text prompt using m-ric/text-to-image."
|
| 10 |
+
|
| 11 |
inputs = {
|
| 12 |
"prompt": {
|
| 13 |
+
"type": "str",
|
| 14 |
"description": "Text prompt to generate the image"
|
| 15 |
}
|
| 16 |
}
|
|
|
|
| 21 |
super().__init__()
|
| 22 |
self.client = Client("m-ric/text-to-image")
|
| 23 |
|
| 24 |
+
def run(self, prompt): # Must explicitly match 'inputs' keys
|
| 25 |
return self.client.predict(prompt, api_name="/predict")
|
| 26 |
|
| 27 |
#%% Utility functions
|