ykl7 commited on
Commit
aa32cec
Β·
1 Parent(s): 773fd7c

improve retrieved document parsing

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -122,7 +122,6 @@ def retriever(query: str, selected_retriever: str):
122
  # Add a blinking cursor to simulate typing
123
  placeholder.markdown(text + "β–Œ")
124
  placeholder.markdown(text)
125
- placeholder.markdown("\n")
126
 
127
  if retriever_endpoint == "None":
128
  return ""
@@ -154,7 +153,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 - \n{retrieved_document_titles}"
158
 
159
  with st.chat_message("assistant"):
160
  placeholder = st.empty()
@@ -310,6 +309,10 @@ def main():
310
  if st.sidebar.button("Example 6 S"):
311
  send_preset_message("There was an estimated 30 million cases of pneumonia in young children worldwide in 2010.")
312
 
 
 
 
 
313
  # Handle auto-submission if a button was clicked
314
  if "auto_submit" in st.session_state and st.session_state.auto_submit:
315
  prompt = st.session_state.auto_submit_text
 
122
  # Add a blinking cursor to simulate typing
123
  placeholder.markdown(text + "β–Œ")
124
  placeholder.markdown(text)
 
125
 
126
  if retriever_endpoint == "None":
127
  return ""
 
153
  except:
154
  retrieved_document_titles = retrieved_document_titles + document + ' ||| '
155
 
156
+ display_retrieved_documents = f" ||| Retrieved Documents - ||| {retrieved_document_titles}"
157
 
158
  with st.chat_message("assistant"):
159
  placeholder = st.empty()
 
309
  if st.sidebar.button("Example 6 S"):
310
  send_preset_message("There was an estimated 30 million cases of pneumonia in young children worldwide in 2010.")
311
 
312
+ if st.sidebar.button("New Assessment"):
313
+ st.session_state.messages = [{"role": "assistant", "content": "Let's start verifying the claims here! πŸ‘‡"}]
314
+ st.rerun()
315
+
316
  # Handle auto-submission if a button was clicked
317
  if "auto_submit" in st.session_state and st.session_state.auto_submit:
318
  prompt = st.session_state.auto_submit_text