Spaces:
Sleeping
Sleeping
Added working microfone example
Browse files- .gitignore +2 -0
- app.py +19 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.env
|
2 |
+
flagged
|
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
import nemo.collections.asr as nemo_asr
|
4 |
+
|
5 |
+
|
6 |
+
asr_model = nemo_asr.models.EncDecCTCModelBPE. \
|
7 |
+
from_pretrained("theodotus/stt_uk_squeezeformer_ctc_xs",map_location="cpu")
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
def transcribe(audio):
|
12 |
+
text = asr_model.transcribe([audio], batch_size=1)[0]
|
13 |
+
return text
|
14 |
+
|
15 |
+
|
16 |
+
gr.Interface(
|
17 |
+
fn=transcribe,
|
18 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
19 |
+
outputs="text").launch()
|