Spaces:
Configuration error
Configuration error
aasherkamal216 commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -493,6 +493,9 @@ else:
|
|
| 493 |
for key in session_keys:
|
| 494 |
if key not in st.session_state:
|
| 495 |
st.session_state[key] = []
|
|
|
|
|
|
|
|
|
|
| 496 |
|
| 497 |
######----- Main Interface -----#######
|
| 498 |
chat_col1, chat_col2 = st.columns([1,4])
|
|
@@ -531,9 +534,10 @@ else:
|
|
| 531 |
|
| 532 |
else:
|
| 533 |
|
| 534 |
-
|
| 535 |
|
| 536 |
-
if
|
|
|
|
| 537 |
|
| 538 |
###--- Session state variables ---###
|
| 539 |
if "pdf_docx_uploaded" not in st.session_state:
|
|
@@ -584,4 +588,4 @@ else:
|
|
| 584 |
|
| 585 |
###----- User Question -----###
|
| 586 |
else:
|
| 587 |
-
process_user_input(message_container,
|
|
|
|
| 493 |
for key in session_keys:
|
| 494 |
if key not in st.session_state:
|
| 495 |
st.session_state[key] = []
|
| 496 |
+
|
| 497 |
+
if "transcribed_text" not in st.session_state:
|
| 498 |
+
st.session_state.transcribed_text = None
|
| 499 |
|
| 500 |
######----- Main Interface -----#######
|
| 501 |
chat_col1, chat_col2 = st.columns([1,4])
|
|
|
|
| 534 |
|
| 535 |
else:
|
| 536 |
|
| 537 |
+
st.session_state.transcribed_text = speech_to_text(language="en", just_once=True, key="STT", use_container_width=True)
|
| 538 |
|
| 539 |
+
if st.session_state.transcribed_text:
|
| 540 |
+
speech_file_added = True
|
| 541 |
|
| 542 |
###--- Session state variables ---###
|
| 543 |
if "pdf_docx_uploaded" not in st.session_state:
|
|
|
|
| 588 |
|
| 589 |
###----- User Question -----###
|
| 590 |
else:
|
| 591 |
+
process_user_input(message_container, st.session_state.transcribed_text)
|