Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def translate_speech(audio_data_tuple):
|
|
20 |
sf.write(temp_audio_file.name, audio_data, sample_rate)
|
21 |
|
22 |
# Prepare the input dictionary
|
23 |
-
input_dict = asr_processor(
|
24 |
|
25 |
# Use the ASR model to get the logits
|
26 |
logits = asr_model(input_dict.input_values.to("cpu")).logits
|
|
|
20 |
sf.write(temp_audio_file.name, audio_data, sample_rate)
|
21 |
|
22 |
# Prepare the input dictionary
|
23 |
+
input_dict = asr_processor(audio_data, sampling_rate=sample_rate, return_tensors="pt", padding=True)
|
24 |
|
25 |
# Use the ASR model to get the logits
|
26 |
logits = asr_model(input_dict.input_values.to("cpu")).logits
|