Spaces:
Sleeping
Sleeping
barghavani
commited on
Commit
•
d355ea6
1
Parent(s):
a2dfe55
Update app.py
Browse files
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"
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|