Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,10 +11,13 @@ def caption_image(image):
|
|
| 11 |
caption = processor.decode(out[0], skip_special_tokens=True)
|
| 12 |
return caption
|
| 13 |
|
| 14 |
-
iface = gr.Interface(
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
iface.queue()
|
| 20 |
-
iface.launch(share=
|
|
|
|
| 11 |
caption = processor.decode(out[0], skip_special_tokens=True)
|
| 12 |
return caption
|
| 13 |
|
| 14 |
+
iface = gr.Interface(
|
| 15 |
+
fn=caption_image,
|
| 16 |
+
inputs=gr.Image(type="pil"),
|
| 17 |
+
outputs="text",
|
| 18 |
+
title="Image Caption Generator",
|
| 19 |
+
allow_flagging="never"
|
| 20 |
+
)
|
| 21 |
|
| 22 |
+
iface.queue(api_open=True)
|
| 23 |
+
iface.launch(share=False)
|