awacke1 commited on
Commit
1940b32
1 Parent(s): 905f9cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -634,12 +634,20 @@ def main():
634
  documents = get_documents(container)
635
  total_docs = len(documents)
636
 
637
- if total_docs > 5:
638
- documents_to_display = documents[:5]
639
- st.sidebar.info("Showing top 5 most recent documents.")
 
 
 
 
 
 
640
  else:
641
  documents_to_display = documents
642
  st.sidebar.info(f"Showing all {len(documents_to_display)} documents.")
 
 
643
 
644
  if documents_to_display:
645
  # 🎨 View options - "Different strokes for different folks"
 
634
  documents = get_documents(container)
635
  total_docs = len(documents)
636
 
637
+ # Add a slider to let the user choose how many documents to display
638
+ num_docs_to_display = st.slider(
639
+ "Select number of documents to display", 5, 500, 20
640
+ )
641
+
642
+ # Adjust the document display logic based on the slider value
643
+ if total_docs > num_docs_to_display:
644
+ documents_to_display = documents[:num_docs_to_display]
645
+ st.sidebar.info(f"Showing top {num_docs_to_display} most recent documents.")
646
  else:
647
  documents_to_display = documents
648
  st.sidebar.info(f"Showing all {len(documents_to_display)} documents.")
649
+
650
+
651
 
652
  if documents_to_display:
653
  # 🎨 View options - "Different strokes for different folks"