ykl7 commited on
Commit
ccae886
·
1 Parent(s): e378954

improve retrieved document parsing

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -101,7 +101,7 @@ def retriever(query: str, selected_retriever: str):
101
  """Simulate a 'retriever' step, searching for relevant information."""
102
  with st.chat_message("assistant"):
103
  placeholder = st.empty()
104
- text=""
105
 
106
  if selected_retriever == "BM25 Retriever":
107
  message = "Using the BM25 retriever to search for documents related to your query..."
@@ -156,6 +156,10 @@ def retriever(query: str, selected_retriever: str):
156
 
157
  display_retrieved_documents = f" ||| Retrieved Documents: \n{retrieved_document_titles}"
158
 
 
 
 
 
159
  for chunk in display_retrieved_documents.split():
160
  if chunk == "|||":
161
  text += chunk + "\n"
@@ -173,7 +177,7 @@ def reasoner(query: str, documents: list[str], selected_reasoner: str, llm_clien
173
  """Simulate a 'reasoner' step, thinking about how to answer."""
174
  with st.chat_message("assistant"):
175
  placeholder = st.empty()
176
- text=""
177
 
178
  if selected_reasoner == "Claude Sonnet":
179
  message = "Using Claude Sonnet to reason and verify the claim..."
 
101
  """Simulate a 'retriever' step, searching for relevant information."""
102
  with st.chat_message("assistant"):
103
  placeholder = st.empty()
104
+ text = ""
105
 
106
  if selected_retriever == "BM25 Retriever":
107
  message = "Using the BM25 retriever to search for documents related to your query..."
 
156
 
157
  display_retrieved_documents = f" ||| Retrieved Documents: \n{retrieved_document_titles}"
158
 
159
+ with st.chat_message("assistant"):
160
+ placeholder = st.empty()
161
+ text = ""
162
+
163
  for chunk in display_retrieved_documents.split():
164
  if chunk == "|||":
165
  text += chunk + "\n"
 
177
  """Simulate a 'reasoner' step, thinking about how to answer."""
178
  with st.chat_message("assistant"):
179
  placeholder = st.empty()
180
+ text = ""
181
 
182
  if selected_reasoner == "Claude Sonnet":
183
  message = "Using Claude Sonnet to reason and verify the claim..."