Update app.py
Browse files
app.py
CHANGED
@@ -147,6 +147,10 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
147 |
message_history = "\n".join(list(get_message_history())[-3:])
|
148 |
result = qa_chain(prompt)
|
149 |
output = [result['result']]
|
|
|
|
|
|
|
|
|
150 |
|
151 |
def generate_pdf():
|
152 |
page_number = int(result['source_documents'][0].metadata['page'])
|
@@ -184,10 +188,7 @@ def generate_audio():
|
|
184 |
st.session_state['reference'] = '/home/user/app/pdf2image/default_output.png'
|
185 |
st.session_state['audio'] = ''
|
186 |
|
187 |
-
|
188 |
-
full_response += item
|
189 |
-
message_placeholder.markdown(full_response + "▌")
|
190 |
-
message_placeholder.markdown(full_response)
|
191 |
|
192 |
|
193 |
if "reference" not in st.session_state:
|
|
|
147 |
message_history = "\n".join(list(get_message_history())[-3:])
|
148 |
result = qa_chain(prompt)
|
149 |
output = [result['result']]
|
150 |
+
for item in output:
|
151 |
+
full_response += item
|
152 |
+
message_placeholder.markdown(full_response + "▌")
|
153 |
+
message_placeholder.markdown(full_response)
|
154 |
|
155 |
def generate_pdf():
|
156 |
page_number = int(result['source_documents'][0].metadata['page'])
|
|
|
188 |
st.session_state['reference'] = '/home/user/app/pdf2image/default_output.png'
|
189 |
st.session_state['audio'] = ''
|
190 |
|
191 |
+
|
|
|
|
|
|
|
192 |
|
193 |
|
194 |
if "reference" not in st.session_state:
|