Spaces:
Running
Running
Simplify UI with standard headings and background colors, change to Upload Document
Browse files
app.py
CHANGED
|
@@ -466,10 +466,6 @@ with main_tab1:
|
|
| 466 |
|
| 467 |
# File uploader in the left column
|
| 468 |
with left_col:
|
| 469 |
-
st.markdown("""
|
| 470 |
-
Using the latest `mistral-ocr-latest` model for advanced document understanding.
|
| 471 |
-
""")
|
| 472 |
-
|
| 473 |
# Simple CSS just to fix vertical text in drag and drop area
|
| 474 |
st.markdown("""
|
| 475 |
<style>
|
|
@@ -499,7 +495,10 @@ with main_tab1:
|
|
| 499 |
""", unsafe_allow_html=True)
|
| 500 |
|
| 501 |
# Add heading for the file uploader (just text, no container)
|
| 502 |
-
st.markdown('## Upload
|
|
|
|
|
|
|
|
|
|
| 503 |
|
| 504 |
# Enhanced file uploader with better help text
|
| 505 |
uploaded_file = st.file_uploader("Drag and drop PDFs or images here", type=["pdf", "png", "jpg", "jpeg"],
|
|
@@ -1189,18 +1188,18 @@ with main_tab1:
|
|
| 1189 |
# Document results will be shown in the right column
|
| 1190 |
with right_col:
|
| 1191 |
|
| 1192 |
-
# Add Document Metadata section
|
| 1193 |
-
st.
|
| 1194 |
|
| 1195 |
-
# Create metadata card with
|
| 1196 |
-
metadata_html = '<div class="metadata-card" style="
|
| 1197 |
|
| 1198 |
# File info
|
| 1199 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
| 1200 |
|
| 1201 |
-
# Info about limited pages
|
| 1202 |
if 'limited_pages' in result:
|
| 1203 |
-
metadata_html += f'<p style="
|
| 1204 |
|
| 1205 |
# Languages
|
| 1206 |
if 'languages' in result:
|
|
@@ -1223,8 +1222,8 @@ with main_tab1:
|
|
| 1223 |
# Render the metadata HTML
|
| 1224 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
| 1225 |
|
| 1226 |
-
# Add content section heading -
|
| 1227 |
-
st.
|
| 1228 |
|
| 1229 |
# Start document content div with consistent styling class
|
| 1230 |
st.markdown('<div class="document-content" style="margin-top:10px;">', unsafe_allow_html=True)
|
|
|
|
| 466 |
|
| 467 |
# File uploader in the left column
|
| 468 |
with left_col:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 469 |
# Simple CSS just to fix vertical text in drag and drop area
|
| 470 |
st.markdown("""
|
| 471 |
<style>
|
|
|
|
| 495 |
""", unsafe_allow_html=True)
|
| 496 |
|
| 497 |
# Add heading for the file uploader (just text, no container)
|
| 498 |
+
st.markdown('## Upload Document')
|
| 499 |
+
|
| 500 |
+
# Model info below the heading
|
| 501 |
+
st.markdown("Using the latest `mistral-ocr-latest` model for advanced document understanding.")
|
| 502 |
|
| 503 |
# Enhanced file uploader with better help text
|
| 504 |
uploaded_file = st.file_uploader("Drag and drop PDFs or images here", type=["pdf", "png", "jpg", "jpeg"],
|
|
|
|
| 1188 |
# Document results will be shown in the right column
|
| 1189 |
with right_col:
|
| 1190 |
|
| 1191 |
+
# Add Document Metadata section header
|
| 1192 |
+
st.subheader("Document Metadata")
|
| 1193 |
|
| 1194 |
+
# Create metadata card with standard styling
|
| 1195 |
+
metadata_html = '<div class="metadata-card" style="padding:15px; margin-bottom:20px;">'
|
| 1196 |
|
| 1197 |
# File info
|
| 1198 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
| 1199 |
|
| 1200 |
+
# Info about limited pages
|
| 1201 |
if 'limited_pages' in result:
|
| 1202 |
+
metadata_html += f'<p style="padding:8px; border-radius:4px;"><strong>Pages:</strong> {result["limited_pages"]["processed"]} of {result["limited_pages"]["total"]} processed</p>'
|
| 1203 |
|
| 1204 |
# Languages
|
| 1205 |
if 'languages' in result:
|
|
|
|
| 1222 |
# Render the metadata HTML
|
| 1223 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
| 1224 |
|
| 1225 |
+
# Add content section heading - using standard subheader
|
| 1226 |
+
st.subheader("Document Content")
|
| 1227 |
|
| 1228 |
# Start document content div with consistent styling class
|
| 1229 |
st.markdown('<div class="document-content" style="margin-top:10px;">', unsafe_allow_html=True)
|