Spaces:
Sleeping
Sleeping
Baptiste Canton
commited on
Commit
·
c620a85
1
Parent(s):
9d49c48
fix
Browse files- captioner.py +6 -4
captioner.py
CHANGED
|
@@ -54,8 +54,10 @@ async def startup_event():
|
|
| 54 |
global app
|
| 55 |
asyncio.create_task(asyncio.to_thread(load_model))
|
| 56 |
# add gradio interface
|
| 57 |
-
iface = gr.Interface(
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
|
| 60 |
|
| 61 |
async def captioner_gradapter(image_url):
|
|
@@ -66,9 +68,9 @@ async def captioner_gradapter(image_url):
|
|
| 66 |
return caption
|
| 67 |
|
| 68 |
|
| 69 |
-
@app.get("/")
|
| 70 |
async def root():
|
| 71 |
-
return {"message": "Hello World"}
|
| 72 |
|
| 73 |
|
| 74 |
# the image url is passed in as a "url" tag in the json body
|
|
|
|
| 54 |
global app
|
| 55 |
asyncio.create_task(asyncio.to_thread(load_model))
|
| 56 |
# add gradio interface
|
| 57 |
+
iface = gr.Interface(
|
| 58 |
+
fn=captioner_gradapter, inputs="text", outputs=["text"], allow_flagging="never"
|
| 59 |
+
)
|
| 60 |
+
app = gr.mount_gradio_app(app, iface, path="/")
|
| 61 |
|
| 62 |
|
| 63 |
async def captioner_gradapter(image_url):
|
|
|
|
| 68 |
return caption
|
| 69 |
|
| 70 |
|
| 71 |
+
""" @app.get("/")
|
| 72 |
async def root():
|
| 73 |
+
return {"message": "Hello World"} """
|
| 74 |
|
| 75 |
|
| 76 |
# the image url is passed in as a "url" tag in the json body
|