Spaces:
Running
Running
Added base streaming example
Browse files
app.py
CHANGED
@@ -8,12 +8,20 @@ asr_model = nemo_asr.models.EncDecCTCModelBPE. \
|
|
8 |
|
9 |
|
10 |
|
11 |
-
def transcribe(audio):
|
12 |
text = asr_model.transcribe([audio], batch_size=1)[0]
|
13 |
-
|
|
|
14 |
|
15 |
|
16 |
gr.Interface(
|
17 |
fn=transcribe,
|
18 |
-
inputs=
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
|
11 |
+
def transcribe(audio, state=""):
|
12 |
text = asr_model.transcribe([audio], batch_size=1)[0]
|
13 |
+
state += text + " "
|
14 |
+
return state, state
|
15 |
|
16 |
|
17 |
gr.Interface(
|
18 |
fn=transcribe,
|
19 |
+
inputs=[
|
20 |
+
gr.Audio(source="microphone", type="filepath", streaming=True),
|
21 |
+
"state"
|
22 |
+
],
|
23 |
+
outputs=[
|
24 |
+
"textbox",
|
25 |
+
"state"
|
26 |
+
],
|
27 |
+
live=True).launch()
|