Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ bark_model.to(device)
|
|
25 |
def translate(audio):
|
26 |
sr, y = audio
|
27 |
if sr != 16000:
|
28 |
-
y = librosa.resample(y, sr, 16000)
|
29 |
y = y.astype(np.float32)
|
30 |
y /= np.max(np.abs(y))
|
31 |
inputs = asr_processor(y, sampling_rate=16000, return_tensors="pt")
|
|
|
25 |
def translate(audio):
|
26 |
sr, y = audio
|
27 |
if sr != 16000:
|
28 |
+
y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
29 |
y = y.astype(np.float32)
|
30 |
y /= np.max(np.abs(y))
|
31 |
inputs = asr_processor(y, sampling_rate=16000, return_tensors="pt")
|