Ahsen Khaliq commited on
Commit
f844e26
1 Parent(s): 3571c3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -9,15 +9,11 @@ processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-large-robust-ft
9
  model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-large-robust-ft-libri-960h")
10
 
11
  # define function to read in sound file
12
- #def map_to_array(file):
13
- # speech, _ = sf.read(file)
14
- # return speech
15
 
16
- batch = []
17
- def map_to_array(audio):
18
- speech, _ = sf.read(batch[audio])
19
- batch["speech"] = speech
20
- return batch
21
 
22
  # tokenize
23
  def inference(audio):
 
9
  model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-large-robust-ft-libri-960h")
10
 
11
  # define function to read in sound file
12
+ def map_to_array(file):
13
+ speech, _ = sf.read(file)
14
+ return speech
15
 
16
+
 
 
 
 
17
 
18
  # tokenize
19
  def inference(audio):