Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,7 @@ def create_gradio_app(api_spec, api_url):
|
|
83 |
if output_schema["type"] == "string":
|
84 |
if "format" in output_schema:
|
85 |
if(output_schema["format"] == "uri"):
|
86 |
-
output_component = gr.
|
87 |
else:
|
88 |
output_component = gr.Textbox(label="Output")
|
89 |
else:
|
@@ -92,7 +92,7 @@ def create_gradio_app(api_spec, api_url):
|
|
92 |
elif output_schema["type"] == "array":
|
93 |
if "format" in output_schema["items"]:
|
94 |
if(output_schema["items"]["format"] == "uri"):
|
95 |
-
output_component = gr.
|
96 |
else:
|
97 |
output_component = gr.Textbox(label=output_schema["title"])
|
98 |
else:
|
@@ -126,7 +126,7 @@ def create_gradio_app(api_spec, api_url):
|
|
126 |
image_stream = io.BytesIO(image_data)
|
127 |
output_images.append(Image.open(image_stream))
|
128 |
|
129 |
-
return output_images
|
130 |
else:
|
131 |
raise gr.Error("The submission failed!")
|
132 |
return gr.Interface(fn=predict, inputs=inputs, outputs=outputs if outputs else "textbox")
|
|
|
83 |
if output_schema["type"] == "string":
|
84 |
if "format" in output_schema:
|
85 |
if(output_schema["format"] == "uri"):
|
86 |
+
output_component = gr.Image(label=output_schema["title"])
|
87 |
else:
|
88 |
output_component = gr.Textbox(label="Output")
|
89 |
else:
|
|
|
92 |
elif output_schema["type"] == "array":
|
93 |
if "format" in output_schema["items"]:
|
94 |
if(output_schema["items"]["format"] == "uri"):
|
95 |
+
output_component = gr.Image(label=output_schema["title"])
|
96 |
else:
|
97 |
output_component = gr.Textbox(label=output_schema["title"])
|
98 |
else:
|
|
|
126 |
image_stream = io.BytesIO(image_data)
|
127 |
output_images.append(Image.open(image_stream))
|
128 |
|
129 |
+
return output_images[0], keys
|
130 |
else:
|
131 |
raise gr.Error("The submission failed!")
|
132 |
return gr.Interface(fn=predict, inputs=inputs, outputs=outputs if outputs else "textbox")
|