Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,6 +56,11 @@ def main(answer_mode: str):
|
|
56 |
final_response = base_model_chatbot(st.session_state.messages)
|
57 |
elif answer_mode == 'pdf_chat':
|
58 |
final_response = with_pdf_chatbot(st.session_state.messages)
|
|
|
|
|
|
|
|
|
|
|
59 |
with st.spinner("Generating audio response..."):
|
60 |
audio_file = text_to_speech(final_response)
|
61 |
autoplay_audio(audio_file)
|
@@ -67,4 +72,4 @@ def main(answer_mode: str):
|
|
67 |
footer_container.float("bottom: 0rem;")
|
68 |
|
69 |
if __name__ == "__main__":
|
70 |
-
main(answer_mode='base_model') # Or: answer_mode='
|
|
|
56 |
final_response = base_model_chatbot(st.session_state.messages)
|
57 |
elif answer_mode == 'pdf_chat':
|
58 |
final_response = with_pdf_chatbot(st.session_state.messages)
|
59 |
+
|
60 |
+
# Ensure response ends with proper punctuation
|
61 |
+
if final_response[-1] not in ".!?":
|
62 |
+
final_response += " Please let me know if this answers your question completely."
|
63 |
+
|
64 |
with st.spinner("Generating audio response..."):
|
65 |
audio_file = text_to_speech(final_response)
|
66 |
autoplay_audio(audio_file)
|
|
|
72 |
footer_container.float("bottom: 0rem;")
|
73 |
|
74 |
if __name__ == "__main__":
|
75 |
+
main(answer_mode='base_model') # Or: answer_mode='pdf_chat'
|