Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ import plotly.graph_objects as go
|
|
16 |
|
17 |
ASR_EXAMPLES = [("assets/bach.wav")]
|
18 |
|
19 |
-
aes_predictor = aes_infer.
|
20 |
|
21 |
|
22 |
def transcribe(audio_data=None):
|
@@ -41,9 +41,8 @@ def transcribe(audio_data=None):
|
|
41 |
)
|
42 |
audio_samples, sr = torchaudio.load(audio_data)
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
)
|
47 |
|
48 |
# reorder like paper figures
|
49 |
transcription = {
|
@@ -92,10 +91,6 @@ main_interface = gr.Interface(
|
|
92 |
allow_flagging="never",
|
93 |
)
|
94 |
|
95 |
-
disclaimer = """
|
96 |
-
## Disclaimer
|
97 |
-
"""
|
98 |
-
|
99 |
with gr.Blocks() as demo:
|
100 |
gr.HTML(
|
101 |
"""
|
@@ -126,8 +121,6 @@ with gr.Blocks() as demo:
|
|
126 |
"""
|
127 |
)
|
128 |
|
129 |
-
# with gr.Row():
|
130 |
-
# gr.Markdown(disclaimer)
|
131 |
|
132 |
if __name__ == "__main__":
|
133 |
demo.queue()
|
|
|
16 |
|
17 |
ASR_EXAMPLES = [("assets/bach.wav")]
|
18 |
|
19 |
+
aes_predictor = aes_infer.initialize_predictor()
|
20 |
|
21 |
|
22 |
def transcribe(audio_data=None):
|
|
|
41 |
)
|
42 |
audio_samples, sr = torchaudio.load(audio_data)
|
43 |
|
44 |
+
# run prediction
|
45 |
+
transcription = aes_predictor.forward([{"path": audio_samples, "sample_rate": sr}])[0]
|
|
|
46 |
|
47 |
# reorder like paper figures
|
48 |
transcription = {
|
|
|
91 |
allow_flagging="never",
|
92 |
)
|
93 |
|
|
|
|
|
|
|
|
|
94 |
with gr.Blocks() as demo:
|
95 |
gr.HTML(
|
96 |
"""
|
|
|
121 |
"""
|
122 |
)
|
123 |
|
|
|
|
|
124 |
|
125 |
if __name__ == "__main__":
|
126 |
demo.queue()
|