Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ translation_model = AutoModelForSeq2SeqLM.from_pretrained("Baghdad99/saad-hausa-
|
|
11 |
tts_tokenizer = AutoTokenizer.from_pretrained("Baghdad99/english_voice_tts")
|
12 |
tts_model = AutoModelForTextToWaveform.from_pretrained("Baghdad99/english_voice_tts")
|
13 |
|
14 |
-
#
|
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
|
|
|
11 |
tts_tokenizer = AutoTokenizer.from_pretrained("Baghdad99/english_voice_tts")
|
12 |
tts_model = AutoModelForTextToWaveform.from_pretrained("Baghdad99/english_voice_tts")
|
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
|