Spaces:
Build error
Build error
Commit
·
9723177
1
Parent(s):
ac8d0e5
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,14 +23,15 @@ def out(audio):
|
|
| 23 |
if audio==None:
|
| 24 |
return "no audio"
|
| 25 |
|
| 26 |
-
|
| 27 |
a = s2t(audio)
|
| 28 |
#g = grammar(a)
|
| 29 |
#s = sum_it(g) # Summarize Audio with sum_it
|
| 30 |
-
return a
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
#else:
|
| 33 |
-
# return "something is wrong in the function?"
|
| 34 |
|
| 35 |
# Construct Interfaces:
|
| 36 |
iface = gr.Interface(
|
|
@@ -38,7 +39,7 @@ iface = gr.Interface(
|
|
| 38 |
title="Speech Audio to text (with corrected grammar)",
|
| 39 |
description="Let's Hear It!! This app transforms your speech (input) to text with corrected grammar after (output)!",
|
| 40 |
inputs= gr.inputs.Audio(source="microphone", type="filepath", label=None, optional=True),
|
| 41 |
-
outputs=
|
| 42 |
)
|
| 43 |
|
| 44 |
# Launch Interface
|
|
|
|
| 23 |
if audio==None:
|
| 24 |
return "no audio"
|
| 25 |
|
| 26 |
+
elif flag:
|
| 27 |
a = s2t(audio)
|
| 28 |
#g = grammar(a)
|
| 29 |
#s = sum_it(g) # Summarize Audio with sum_it
|
| 30 |
+
return a #grammar(a, num_return_sequences=1) # grammar(s), # Grammar Filter
|
| 31 |
+
|
| 32 |
+
else:
|
| 33 |
+
return "something is wrong in the function?"
|
| 34 |
|
|
|
|
|
|
|
| 35 |
|
| 36 |
# Construct Interfaces:
|
| 37 |
iface = gr.Interface(
|
|
|
|
| 39 |
title="Speech Audio to text (with corrected grammar)",
|
| 40 |
description="Let's Hear It!! This app transforms your speech (input) to text with corrected grammar after (output)!",
|
| 41 |
inputs= gr.inputs.Audio(source="microphone", type="filepath", label=None, optional=True),
|
| 42 |
+
outputs= 'text'
|
| 43 |
)
|
| 44 |
|
| 45 |
# Launch Interface
|