Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -634,12 +634,20 @@ def main():
|
|
634 |
documents = get_documents(container)
|
635 |
total_docs = len(documents)
|
636 |
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|