Irpan commited on
Commit
badbaf4
·
1 Parent(s): 18f99c6
Files changed (1) hide show
  1. asr.py +1 -0
asr.py CHANGED
@@ -31,6 +31,7 @@ def asr(audio_data, target_rate = 16000):
31
  if sampling_rate != target_rate:
32
  resampler = torchaudio.transforms.Resample(sampling_rate, target_rate)
33
  audio_input = resampler(audio_input)
 
34
 
35
  # Process audio through ASR model
36
  inputs = asr_processor(audio_input.squeeze(), sampling_rate=sampling_rate, return_tensors="pt", padding=True)
 
31
  if sampling_rate != target_rate:
32
  resampler = torchaudio.transforms.Resample(sampling_rate, target_rate)
33
  audio_input = resampler(audio_input)
34
+ sampling_rate = target_rate
35
 
36
  # Process audio through ASR model
37
  inputs = asr_processor(audio_input.squeeze(), sampling_rate=sampling_rate, return_tensors="pt", padding=True)