barghavani commited on
Commit
d355ea6
1 Parent(s): a2dfe55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -88,9 +88,17 @@ def main():
88
  f.write(wav_audio_data)
89
 
90
  model = whisper.load_model("large")
91
- result = model.transcribe("query.wav", language="en", fp16=False)
92
- user_question = result["text"]
93
- st.write("Transcribed Question:", user_question)
 
 
 
 
 
 
 
 
94
  user_input(user_question)
95
 
96
  with st.sidebar:
 
88
  f.write(wav_audio_data)
89
 
90
  model = whisper.load_model("large")
91
+ result = model.transcribe("query.wav")
92
+ detected_language = result["language"]
93
+ transcribed_text = result["text"]
94
+
95
+ translator = Translator()
96
+ translation = translator.translate(transcribed_text, dest="en")
97
+ user_question = translation.text
98
+
99
+ st.write("Detected Language:", detected_language)
100
+ st.write("Transcribed Text:", transcribed_text)
101
+ st.write("Translated Question:", user_question)
102
  user_input(user_question)
103
 
104
  with st.sidebar: