Simonlob commited on
Commit
75dfdb4
·
verified ·
1 Parent(s): a9569f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -6,8 +6,8 @@ import librosa
6
  import numpy as np
7
  import re
8
 
9
- processor = Wav2Vec2Processor.from_pretrained("the-cramer-project/Wav2vec-Kyrgyz")
10
- model = Wav2Vec2ForCTC.from_pretrained("the-cramer-project/Wav2vec-Kyrgyz")
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 Kyrgyz",
32
- description="Realtime demo for Kyrgyz speech recognition using a wave2vec model.",
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()