Spaces:
Runtime error
Runtime error
Benjamin Bossan
commited on
Commit
•
465300f
1
Parent(s):
4e71b4d
Improve demo wording, error fallback
Browse files
demo.py
CHANGED
@@ -5,8 +5,12 @@ import gradio as gr
|
|
5 |
def submit(inputs):
|
6 |
if not inputs:
|
7 |
return
|
|
|
8 |
payload = {"content": inputs, "author": "anna nymous"}
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
def check_status():
|
@@ -67,7 +71,7 @@ Input currently supports:
|
|
67 |
- plain text
|
68 |
- a URL to a webpage
|
69 |
- a URL to a youtube video (the video will be transcribed)
|
70 |
-
- a URL to an image (the image description will be used)
|
71 |
"""
|
72 |
|
73 |
|
|
|
5 |
def submit(inputs):
|
6 |
if not inputs:
|
7 |
return
|
8 |
+
|
9 |
payload = {"content": inputs, "author": "anna nymous"}
|
10 |
+
try:
|
11 |
+
httpx.post("http://localhost:8080/submit/", json=payload)
|
12 |
+
except httpx.ConnectError:
|
13 |
+
pass
|
14 |
|
15 |
|
16 |
def check_status():
|
|
|
71 |
- plain text
|
72 |
- a URL to a webpage
|
73 |
- a URL to a youtube video (the video will be transcribed)
|
74 |
+
- a URL to an image (url ending in .png, .jpg, etc.; the image description will be used)
|
75 |
"""
|
76 |
|
77 |
|