Spaces:
Runtime error
Runtime error
osanseviero
commited on
Commit
•
0bca911
1
Parent(s):
015d6fb
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def call_api(message):
|
4 |
+
"""
|
5 |
+
response = requests.get(f'{api}?q={message}')
|
6 |
+
if response.status_code == 200:
|
7 |
+
|
8 |
+
return str(response.text).split('\n', 2)[2]
|
9 |
+
else:
|
10 |
+
return Sorry, I'm quite busy right now, but please try again later :)
|
11 |
+
"""
|
12 |
+
return message
|
13 |
+
|
14 |
+
|
15 |
+
demo = gr.Interface(
|
16 |
+
call_api,
|
17 |
+
gr.Audio(source="microphone"),
|
18 |
+
gr.Audio(),
|
19 |
+
)
|