Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
080434a
1
Parent(s):
e84a7c3
Update app.py
Browse files
app.py
CHANGED
@@ -9,9 +9,15 @@ 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 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# tokenize
|
17 |
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 |
+
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):
|