Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,14 @@ if page == "Charges Incurred":
|
|
| 38 |
elif page == "Invoices to Table":
|
| 39 |
st.title("Invoice Table Extractor")
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
uploaded_file = st.file_uploader("π€ Upload Invoice Image", type=["jpg", "jpeg", "png"])
|
| 42 |
col1, col2 = st.columns([1.5, 1]) # col1 = processing, col2 = image
|
| 43 |
|
|
@@ -51,18 +59,7 @@ elif page == "Invoices to Table":
|
|
| 51 |
st.subheader("πΌοΈ Invoice Preview")
|
| 52 |
st.image(uploaded_file, use_container_width=True)
|
| 53 |
|
| 54 |
-
|
| 55 |
-
col1, col2 = st.columns([1, 3])
|
| 56 |
-
with col1:
|
| 57 |
-
st.markdown("### π’ Select Max Token Limit")
|
| 58 |
-
selected_token_limit = st.radio(
|
| 59 |
-
"Choose token limit for LLM:",
|
| 60 |
-
options=[512, 1024, 2048, 4096],
|
| 61 |
-
index=3,
|
| 62 |
-
horizontal=True,
|
| 63 |
-
key="token_selector"
|
| 64 |
-
)
|
| 65 |
-
|
| 66 |
with col1:
|
| 67 |
with st.spinner("π Running OCR..."):
|
| 68 |
text = run_ocr_with_gcv(image_path)
|
|
|
|
| 38 |
elif page == "Invoices to Table":
|
| 39 |
st.title("Invoice Table Extractor")
|
| 40 |
|
| 41 |
+
st.sidebar.markdown("### π’ Max Tokens for LLM")
|
| 42 |
+
selected_token_limit = st.sidebar.radio(
|
| 43 |
+
"Choose max tokens:",
|
| 44 |
+
options=[512, 1024, 2048, 4096],
|
| 45 |
+
index=3,
|
| 46 |
+
key="token_selector_sidebar"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
uploaded_file = st.file_uploader("π€ Upload Invoice Image", type=["jpg", "jpeg", "png"])
|
| 50 |
col1, col2 = st.columns([1.5, 1]) # col1 = processing, col2 = image
|
| 51 |
|
|
|
|
| 59 |
st.subheader("πΌοΈ Invoice Preview")
|
| 60 |
st.image(uploaded_file, use_container_width=True)
|
| 61 |
|
| 62 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
with col1:
|
| 64 |
with st.spinner("π Running OCR..."):
|
| 65 |
text = run_ocr_with_gcv(image_path)
|