Spaces:
Runtime error
Runtime error
jiaofengxu
commited on
Commit
Β·
bc83513
1
Parent(s):
a90f28f
nvidia VR
Browse files- app.py +8 -2
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
|
|
|
|
3 |
|
4 |
#model = pipeline("automatic-speech-recognition")
|
5 |
#model = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
|
6 |
-
model = pipeline("automatic-speech-recognition", model="
|
|
|
|
|
|
|
7 |
|
8 |
def transcribe_audio(mic=None, file=None):
|
9 |
if mic is not None:
|
@@ -12,7 +17,8 @@ def transcribe_audio(mic=None, file=None):
|
|
12 |
audio = file
|
13 |
else:
|
14 |
return "You must either provide a mic recording or a file"
|
15 |
-
transcription = model(audio)["text"]
|
|
|
16 |
return transcription
|
17 |
|
18 |
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
+
import nemo.collections.asr as nemo_asr
|
4 |
+
|
5 |
|
6 |
#model = pipeline("automatic-speech-recognition")
|
7 |
#model = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
|
8 |
+
#model = pipeline("automatic-speech-recognition", model="nvidia/parakeet-ctc-0.6b")
|
9 |
+
|
10 |
+
asr_model = nemo_asr.models.EncDecCTCModelBPE.from_pretrained(model_name="nvidia/parakeet-ctc-1.1b")
|
11 |
+
|
12 |
|
13 |
def transcribe_audio(mic=None, file=None):
|
14 |
if mic is not None:
|
|
|
17 |
audio = file
|
18 |
else:
|
19 |
return "You must either provide a mic recording or a file"
|
20 |
+
#transcription = model(audio)["text"]
|
21 |
+
transcription = asr_model(audio)
|
22 |
return transcription
|
23 |
|
24 |
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
transformers
|
2 |
-
torch
|
|
|
|
1 |
transformers
|
2 |
+
torch
|
3 |
+
nemo_toolkit['all']
|