leofltt commited on
Commit
29616dd
·
verified ·
1 Parent(s): 275ebc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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")