Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,15 +84,10 @@ def handle_userinput(user_question):
|
|
| 84 |
for i, (message, text) in enumerate(zip(st.session_state.chat_history, st.session_state.retrieved_text)):
|
| 85 |
if i % 2 == 0:
|
| 86 |
st.write(user_template.replace(
|
| 87 |
-
"{{MSG}}", message.content), unsafe_allow_html=True)
|
| 88 |
-
st.write(user_template.replace(
|
| 89 |
-
"{{MSG}}", text.content), unsafe_allow_html=True)
|
| 90 |
-
|
| 91 |
else:
|
| 92 |
st.write(bot_template.replace(
|
| 93 |
-
"{{MSG}}", message.content), unsafe_allow_html=True)
|
| 94 |
-
st.write(bot_template.replace(
|
| 95 |
-
"{{MSG}}", text.content), unsafe_allow_html=True)
|
| 96 |
|
| 97 |
|
| 98 |
|
|
@@ -107,8 +102,6 @@ if "conversation" not in st.session_state:
|
|
| 107 |
st.session_state.conversation = None
|
| 108 |
if "chat_history" not in st.session_state:
|
| 109 |
st.session_state.chat_history = None
|
| 110 |
-
if "retrieved_text" not in st.session_state:
|
| 111 |
-
st.session_state.retrieved_text = None
|
| 112 |
|
| 113 |
st.header("Chat with multiple PDFs :books:")
|
| 114 |
user_question = st.text_input("Ask a question about your documents:")
|
|
|
|
| 84 |
for i, (message, text) in enumerate(zip(st.session_state.chat_history, st.session_state.retrieved_text)):
|
| 85 |
if i % 2 == 0:
|
| 86 |
st.write(user_template.replace(
|
| 87 |
+
"{{MSG}}", message.content, text.content), unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
| 88 |
else:
|
| 89 |
st.write(bot_template.replace(
|
| 90 |
+
"{{MSG}}", message.content, text.content), unsafe_allow_html=True)
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
|
|
|
|
| 102 |
st.session_state.conversation = None
|
| 103 |
if "chat_history" not in st.session_state:
|
| 104 |
st.session_state.chat_history = None
|
|
|
|
|
|
|
| 105 |
|
| 106 |
st.header("Chat with multiple PDFs :books:")
|
| 107 |
user_question = st.text_input("Ask a question about your documents:")
|