Baghdad99 commited on
Commit
7ae6fbc
·
1 Parent(s): d9741d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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, sampling_rate=sampling_rate)
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])