DebasishDhal99 commited on
Commit
1bce638
·
1 Parent(s): d582d2f

add whisper to backend

Browse files

I should do the testing on colab, but testing is easy here because of microphone option i believe

Files changed (1) hide show
  1. backend/audio_to_tgt.py +5 -1
backend/audio_to_tgt.py CHANGED
@@ -1,2 +1,6 @@
1
  def src_audio_to_eng_translator(audio_file_input):
2
- return "Random"
 
 
 
 
 
1
  def src_audio_to_eng_translator(audio_file_input):
2
+ transcription = client.audio.translations.create(
3
+ model="whisper-1",
4
+ file=audio_file_input,
5
+ )
6
+ return transcription.text