Spaces:
Build error
Build error
Commit
·
fb1bb66
1
Parent(s):
da27dba
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
# >>>>>> Adapted/frankensteined from these scripts: <<<<<<<
|
| 2 |
# for Summary Interface:
|
| 3 |
-
# >>>>https://huggingface.co/spaces/khxu/pegasus-text-summarizers/blob/main/app.py
|
| 4 |
-
#
|
|
|
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
from transformers import pipeline
|
|
@@ -19,12 +20,14 @@ def out(audio):
|
|
| 19 |
if audio==None:
|
| 20 |
return "no audio"
|
| 21 |
|
| 22 |
-
|
| 23 |
a = s2t(audio)
|
| 24 |
g = grammar(a)
|
| 25 |
#s = sum_it(g) # Summarize Audio with sum_it
|
| 26 |
return grammar(a) # grammar(s), # Grammar Filter
|
| 27 |
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Construct Interfaces:
|
| 30 |
iface = gr.Interface(
|
|
|
|
| 1 |
# >>>>>> Adapted/frankensteined from these scripts: <<<<<<<
|
| 2 |
# for Summary Interface:
|
| 3 |
+
# >>>> https://huggingface.co/spaces/khxu/pegasus-text-summarizers/blob/main/app.py
|
| 4 |
+
# Audio Interface
|
| 5 |
+
# >>>> https://huggingface.co/spaces/iSky/Speech-audio-to-text-with-grammar-correction/blob/main/app.py
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
from transformers import pipeline
|
|
|
|
| 20 |
if audio==None:
|
| 21 |
return "no audio"
|
| 22 |
|
| 23 |
+
elif:
|
| 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?"
|
| 31 |
|
| 32 |
# Construct Interfaces:
|
| 33 |
iface = gr.Interface(
|