Spaces:
Sleeping
Sleeping
improve retrieved document parsing
Browse files
app.py
CHANGED
@@ -154,7 +154,7 @@ def retriever(query: str, selected_retriever: str):
|
|
154 |
except:
|
155 |
retrieved_document_titles = retrieved_document_titles + document + ' ||| '
|
156 |
|
157 |
-
display_retrieved_documents = f" ||| Retrieved Documents
|
158 |
|
159 |
with st.chat_message("assistant"):
|
160 |
placeholder = st.empty()
|
@@ -164,7 +164,7 @@ def retriever(query: str, selected_retriever: str):
|
|
164 |
|
165 |
for chunk in display_retrieved_documents.split():
|
166 |
if chunk == "|||":
|
167 |
-
text +=
|
168 |
else:
|
169 |
text += chunk + " "
|
170 |
time.sleep(0.05)
|
@@ -314,7 +314,7 @@ def main():
|
|
314 |
if "auto_submit" in st.session_state and st.session_state.auto_submit:
|
315 |
prompt = st.session_state.auto_submit_text
|
316 |
|
317 |
-
display_message = prompt + " \n"+ " \n"+ f"Retriever: {selected_retriever}, Reasoner: {selected_reasoner}"
|
318 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
319 |
st.session_state.messages.append({"role": "summary", "content": display_message})
|
320 |
|
|
|
154 |
except:
|
155 |
retrieved_document_titles = retrieved_document_titles + document + ' ||| '
|
156 |
|
157 |
+
display_retrieved_documents = f" ||| Retrieved Documents - \n{retrieved_document_titles}"
|
158 |
|
159 |
with st.chat_message("assistant"):
|
160 |
placeholder = st.empty()
|
|
|
164 |
|
165 |
for chunk in display_retrieved_documents.split():
|
166 |
if chunk == "|||":
|
167 |
+
text += " \n" + " \n"
|
168 |
else:
|
169 |
text += chunk + " "
|
170 |
time.sleep(0.05)
|
|
|
314 |
if "auto_submit" in st.session_state and st.session_state.auto_submit:
|
315 |
prompt = st.session_state.auto_submit_text
|
316 |
|
317 |
+
display_message = prompt + " \n" + " \n" + f"Retriever: {selected_retriever}, Reasoner: {selected_reasoner}"
|
318 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
319 |
st.session_state.messages.append({"role": "summary", "content": display_message})
|
320 |
|