ykl7 commited on
Commit
48f8386
·
1 Parent(s): 1cc9139

fix iterator

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -154,9 +154,9 @@ def retriever(query: str, selected_retriever: str):
154
 
155
  for idx, document in enumerate(topk_documents):
156
  try:
157
- idx = document.lower().index("abstract:")
158
- title = document[:idx].replace('\n', ' ')
159
- doc_details = document[idx:]
160
  with st.expander(f"Rank {ix+1} - {title}"):
161
  st.markdown(f"{doc_details}")
162
  except:
 
154
 
155
  for idx, document in enumerate(topk_documents):
156
  try:
157
+ a_idx = document.lower().index("abstract:")
158
+ title = document[:a_idx].replace('\n', ' ')
159
+ doc_details = document[a_idx:]
160
  with st.expander(f"Rank {ix+1} - {title}"):
161
  st.markdown(f"{doc_details}")
162
  except: