Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ import librosa
|
|
6 |
import numpy as np
|
7 |
import re
|
8 |
|
9 |
-
processor = Wav2Vec2Processor.from_pretrained("
|
10 |
-
model = Wav2Vec2ForCTC.from_pretrained("
|
11 |
# model.to("cuda")
|
12 |
|
13 |
def transcribe(file_):
|
@@ -19,7 +19,7 @@ def transcribe(file_):
|
|
19 |
|
20 |
pred_ids = torch.argmax(logits, dim=-1)
|
21 |
text = processor.batch_decode(pred_ids)[0]
|
22 |
-
return text
|
23 |
|
24 |
|
25 |
|
@@ -28,8 +28,8 @@ iface = gr.Interface(
|
|
28 |
fn=transcribe,
|
29 |
inputs=gr.Audio(type="filepath"),
|
30 |
outputs="text",
|
31 |
-
title="Wave2Vec
|
32 |
-
description="Realtime demo for
|
33 |
)
|
34 |
|
35 |
iface.launch()
|
|
|
6 |
import numpy as np
|
7 |
import re
|
8 |
|
9 |
+
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
|
10 |
+
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
|
11 |
# model.to("cuda")
|
12 |
|
13 |
def transcribe(file_):
|
|
|
19 |
|
20 |
pred_ids = torch.argmax(logits, dim=-1)
|
21 |
text = processor.batch_decode(pred_ids)[0]
|
22 |
+
return text.lower()
|
23 |
|
24 |
|
25 |
|
|
|
28 |
fn=transcribe,
|
29 |
inputs=gr.Audio(type="filepath"),
|
30 |
outputs="text",
|
31 |
+
title="Wave2Vec EN",
|
32 |
+
description="Realtime demo for English speech recognition using a wave2vec model.",
|
33 |
)
|
34 |
|
35 |
iface.launch()
|