Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ tts_model = AutoModelForTextToWaveform.from_pretrained("Baghdad99/english_voice_
|
|
13 |
|
14 |
# Modify the translate function to accept the sampling_rate argument
|
15 |
def translate(audio_signal, sampling_rate):
|
16 |
-
inputs = asr_processor(audio_signal, return_tensors="pt", padding=True
|
17 |
logits = asr_model(inputs.input_values).logits
|
18 |
predicted_ids = torch.argmax(logits, dim=-1)
|
19 |
transcription = asr_processor.decode(predicted_ids[0])
|
|
|
13 |
|
14 |
# Modify the translate function to accept the sampling_rate argument
|
15 |
def translate(audio_signal, sampling_rate):
|
16 |
+
inputs = asr_processor(audio_signal, sampling_rate=sampling_rate, return_tensors="pt", padding=True)
|
17 |
logits = asr_model(inputs.input_values).logits
|
18 |
predicted_ids = torch.argmax(logits, dim=-1)
|
19 |
transcription = asr_processor.decode(predicted_ids[0])
|