HakimHa commited on
Commit
0c14a46
Β·
1 Parent(s): 1d2c6ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -75,7 +75,7 @@ def handle_audio(audio):
75
  # gradio Audio returns a tuple (sample_rate, audio_np_array)
76
  # we only need the audio data, hence accessing the second element
77
  audio = audio[1]
78
- input_values = wav2vec2_processor(audio, sampling_rate=audio[0], return_tensors="pt").input_values
79
  # Convert to the expected tensor type
80
  input_values = input_values.to(torch.float32)
81
  logits = wav2vec2_model(input_values).logits
 
75
  # gradio Audio returns a tuple (sample_rate, audio_np_array)
76
  # we only need the audio data, hence accessing the second element
77
  audio = audio[1]
78
+ input_values = wav2vec2_processor(audio, sampling_rate=16000, return_tensors="pt").input_values
79
  # Convert to the expected tensor type
80
  input_values = input_values.to(torch.float32)
81
  logits = wav2vec2_model(input_values).logits