Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,10 @@ transcriber = pipeline("automatic-speech-recognition", model="Oysiyl/w2v-bert-2.
|
|
7 |
|
8 |
def transcribe(audio):
|
9 |
sr, y = audio
|
10 |
-
if sr != 16000:
|
11 |
-
y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
12 |
y = y.astype(np.float32)
|
13 |
y /= np.max(np.abs(y))
|
|
|
|
|
14 |
|
15 |
return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
16 |
|
|
|
7 |
|
8 |
def transcribe(audio):
|
9 |
sr, y = audio
|
|
|
|
|
10 |
y = y.astype(np.float32)
|
11 |
y /= np.max(np.abs(y))
|
12 |
+
if sr != 16000:
|
13 |
+
y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
14 |
|
15 |
return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
16 |
|