Spaces:
Build error
Build error
Commit
·
ab046ec
1
Parent(s):
6e45503
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def out(audio):
|
|
| 24 |
a = s2t(audio)
|
| 25 |
#g = grammar(a)
|
| 26 |
#s = sum_it(g) # Summarize Audio with sum_it
|
| 27 |
-
return grammar(a) # grammar(s), # Grammar Filter
|
| 28 |
|
| 29 |
else:
|
| 30 |
return "something is wrong in the function?"
|
|
@@ -35,11 +35,17 @@ iface = gr.Interface(
|
|
| 35 |
title="Speech Audio to text (with corrected grammar)",
|
| 36 |
description="Let's Hear It!! This app transforms your speech (input) to text with corrected grammar after (output)!",
|
| 37 |
inputs= gr.inputs.Audio(source="microphone", type="filepath", label=None, optional=True),
|
| 38 |
-
outputs= 'text'
|
| 39 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# From Original Code:
|
| 41 |
# gr.inputs.Audio(source="upload", type="filepath", label=None, optional=True),
|
| 42 |
# examples=[["Grammar-Correct-Sample.mp3"], ["Grammar-Wrong-Sample.mp3"],],
|
| 43 |
|
| 44 |
-
#
|
| 45 |
-
|
|
|
|
|
|
|
|
|
| 24 |
a = s2t(audio)
|
| 25 |
#g = grammar(a)
|
| 26 |
#s = sum_it(g) # Summarize Audio with sum_it
|
| 27 |
+
return a, grammar(a) # grammar(s), # Grammar Filter
|
| 28 |
|
| 29 |
else:
|
| 30 |
return "something is wrong in the function?"
|
|
|
|
| 35 |
title="Speech Audio to text (with corrected grammar)",
|
| 36 |
description="Let's Hear It!! This app transforms your speech (input) to text with corrected grammar after (output)!",
|
| 37 |
inputs= gr.inputs.Audio(source="microphone", type="filepath", label=None, optional=True),
|
| 38 |
+
outputs= ['text','text']
|
| 39 |
)
|
| 40 |
+
|
| 41 |
+
# Launch Interface
|
| 42 |
+
iface.launch(enable_queue=True,show_error=True)
|
| 43 |
+
|
| 44 |
# From Original Code:
|
| 45 |
# gr.inputs.Audio(source="upload", type="filepath", label=None, optional=True),
|
| 46 |
# examples=[["Grammar-Correct-Sample.mp3"], ["Grammar-Wrong-Sample.mp3"],],
|
| 47 |
|
| 48 |
+
#def speech_to_text(inp):
|
| 49 |
+
pass # speech recognition model defined here
|
| 50 |
+
|
| 51 |
+
#gr.Interface(speech_to_text, inputs="mic", outputs=gr.Textbox(label="Predicted text", lines=4))
|