Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,7 +82,7 @@ def main():
|
|
| 82 |
st.write("<div style='flex: 1;'></div>", unsafe_allow_html=True)
|
| 83 |
st.write("<!-- End Spacer -->", unsafe_allow_html=True)
|
| 84 |
|
| 85 |
-
|
| 86 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
| 87 |
|
| 88 |
if st.button("Ask") or (query and query != st.session_state.get('last_input', '')):
|
|
@@ -117,6 +117,7 @@ def main():
|
|
| 117 |
# Mark all messages as old after displaying
|
| 118 |
st.session_state['chat_history'] = [(sender, msg, "old") for sender, msg, _ in st.session_state['chat_history']]
|
| 119 |
|
|
|
|
| 120 |
def display_chat_history(chat_history):
|
| 121 |
for chat in chat_history:
|
| 122 |
background_color = "#FFA07A" if chat[2] == "new" else "#acf" if chat[0] == "User" else "#caf"
|
|
|
|
| 82 |
st.write("<div style='flex: 1;'></div>", unsafe_allow_html=True)
|
| 83 |
st.write("<!-- End Spacer -->", unsafe_allow_html=True)
|
| 84 |
|
| 85 |
+
if pdf is not None:
|
| 86 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
| 87 |
|
| 88 |
if st.button("Ask") or (query and query != st.session_state.get('last_input', '')):
|
|
|
|
| 117 |
# Mark all messages as old after displaying
|
| 118 |
st.session_state['chat_history'] = [(sender, msg, "old") for sender, msg, _ in st.session_state['chat_history']]
|
| 119 |
|
| 120 |
+
|
| 121 |
def display_chat_history(chat_history):
|
| 122 |
for chat in chat_history:
|
| 123 |
background_color = "#FFA07A" if chat[2] == "new" else "#acf" if chat[0] == "User" else "#caf"
|