Spaces:
Running
Running
Move sidebar options up with reduced spacing for better visibility
Browse files
app.py
CHANGED
|
@@ -506,18 +506,54 @@ with main_tab1:
|
|
| 506 |
|
| 507 |
# Removed seed prompt instructions from here, moving to sidebar
|
| 508 |
|
| 509 |
-
# Sidebar with options
|
| 510 |
with st.sidebar:
|
| 511 |
-
#
|
| 512 |
-
st.markdown("<h2 style='margin-top:-
|
| 513 |
|
| 514 |
-
#
|
| 515 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
use_vision = st.checkbox("Use Vision Model", value=True,
|
| 517 |
help="For image files, use the vision model for improved analysis (may be slower)")
|
| 518 |
|
| 519 |
-
# Historical Context section
|
| 520 |
-
st.
|
| 521 |
|
| 522 |
# Historical period selector
|
| 523 |
historical_periods = [
|
|
@@ -603,9 +639,9 @@ with st.sidebar:
|
|
| 603 |
```
|
| 604 |
""")
|
| 605 |
|
| 606 |
-
# Image preprocessing options
|
| 607 |
-
st.
|
| 608 |
-
with st.expander("Preprocessing Options"):
|
| 609 |
preprocessing_options = {}
|
| 610 |
|
| 611 |
# Document type selector - important for optimized processing
|
|
@@ -635,9 +671,9 @@ with st.sidebar:
|
|
| 635 |
help="Rotate the document to correct orientation"
|
| 636 |
)
|
| 637 |
|
| 638 |
-
# PDF options
|
| 639 |
-
st.
|
| 640 |
-
with st.expander("PDF Settings"):
|
| 641 |
pdf_dpi = st.slider("PDF Resolution (DPI)", 72, 300, 100,
|
| 642 |
help="Higher DPI gives better quality but slower processing. Try 100 for faster processing.")
|
| 643 |
max_pages = st.number_input("Maximum Pages to Process", 1, 20, 3,
|
|
|
|
| 506 |
|
| 507 |
# Removed seed prompt instructions from here, moving to sidebar
|
| 508 |
|
| 509 |
+
# Sidebar with options - moved up with equal spacing
|
| 510 |
with st.sidebar:
|
| 511 |
+
# Options title with reduced top margin
|
| 512 |
+
st.markdown("<h2 style='margin-top:-25px; margin-bottom:5px; padding:0;'>Options</h2>", unsafe_allow_html=True)
|
| 513 |
|
| 514 |
+
# Reduce spacing between sidebar sections
|
| 515 |
+
st.markdown("""
|
| 516 |
+
<style>
|
| 517 |
+
/* Reduce all spacing in sidebar */
|
| 518 |
+
.block-container {padding-top: 0;}
|
| 519 |
+
.stSidebar .block-container {padding-top: 0 !important;}
|
| 520 |
+
.stSidebar [data-testid='stSidebarNav'] {margin-bottom: 0 !important;}
|
| 521 |
+
.stSidebar [data-testid='stMarkdownContainer'] {margin-bottom: 0 !important; margin-top: 0 !important;}
|
| 522 |
+
.stSidebar [data-testid='stVerticalBlock'] {gap: 0 !important;}
|
| 523 |
+
|
| 524 |
+
/* Make checkbox rows more compact */
|
| 525 |
+
.stCheckbox {margin-bottom: 0 !important; padding-bottom: 0 !important; padding-top: 0 !important;}
|
| 526 |
+
.stExpander {margin-top: 0 !important; margin-bottom: 10px !important;}
|
| 527 |
+
|
| 528 |
+
/* Reduce space between section headings and content */
|
| 529 |
+
.stSidebar h1, .stSidebar h2, .stSidebar h3, .stSidebar h4, .stSidebar h5 {
|
| 530 |
+
margin-top: 0 !important;
|
| 531 |
+
margin-bottom: 0 !important;
|
| 532 |
+
padding-top: 0 !important;
|
| 533 |
+
padding-bottom: 0 !important;
|
| 534 |
+
line-height: 1.2 !important;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
/* Make selectbox and other inputs more compact */
|
| 538 |
+
.stSidebar .stSelectbox, .stSidebar .stSlider, .stSidebar .stNumberInput {
|
| 539 |
+
margin-bottom: 5px !important;
|
| 540 |
+
padding-bottom: 0 !important;
|
| 541 |
+
padding-top: 0 !important;
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
/* Reduce all form element margins */
|
| 545 |
+
.stForm > div {margin-bottom: 5px !important;}
|
| 546 |
+
.stSidebar label {margin-bottom: 0 !important; line-height: 1.2 !important;}
|
| 547 |
+
</style>
|
| 548 |
+
""", unsafe_allow_html=True)
|
| 549 |
+
|
| 550 |
+
# Model options - more compact
|
| 551 |
+
st.markdown("##### Model Settings", help="Configure model options")
|
| 552 |
use_vision = st.checkbox("Use Vision Model", value=True,
|
| 553 |
help="For image files, use the vision model for improved analysis (may be slower)")
|
| 554 |
|
| 555 |
+
# Historical Context section with minimal spacing
|
| 556 |
+
st.markdown("##### Historical Context", help="Add historical context information")
|
| 557 |
|
| 558 |
# Historical period selector
|
| 559 |
historical_periods = [
|
|
|
|
| 639 |
```
|
| 640 |
""")
|
| 641 |
|
| 642 |
+
# Image preprocessing options with reduced spacing
|
| 643 |
+
st.markdown("##### Image Preprocessing", help="Options for enhancing images before OCR")
|
| 644 |
+
with st.expander("Preprocessing Options", expanded=False):
|
| 645 |
preprocessing_options = {}
|
| 646 |
|
| 647 |
# Document type selector - important for optimized processing
|
|
|
|
| 671 |
help="Rotate the document to correct orientation"
|
| 672 |
)
|
| 673 |
|
| 674 |
+
# PDF options with consistent formatting
|
| 675 |
+
st.markdown("##### PDF Options", help="Settings for PDF documents")
|
| 676 |
+
with st.expander("PDF Settings", expanded=False):
|
| 677 |
pdf_dpi = st.slider("PDF Resolution (DPI)", 72, 300, 100,
|
| 678 |
help="Higher DPI gives better quality but slower processing. Try 100 for faster processing.")
|
| 679 |
max_pages = st.number_input("Maximum Pages to Process", 1, 20, 3,
|