Update app.py
Browse files
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=
|
| 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
|