Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,7 +139,7 @@ def process_document():
|
|
| 139 |
details = query_gemini(extract_prompt, image_b64)
|
| 140 |
|
| 141 |
# Verify authenticity
|
| 142 |
-
verify_prompt = "Analyze this document for signs of tampering. Provide verification status in short
|
| 143 |
verification = query_gemini(verify_prompt, image_b64)
|
| 144 |
|
| 145 |
st.session_state.processed_doc = {
|
|
@@ -163,11 +163,6 @@ def main():
|
|
| 163 |
# Sidebar Controls
|
| 164 |
with st.sidebar:
|
| 165 |
st.header("Document Controls")
|
| 166 |
-
# If a document preview exists, show it above the upload button
|
| 167 |
-
if st.session_state.get("doc_preview"):
|
| 168 |
-
st.subheader("Document Preview")
|
| 169 |
-
st.image(st.session_state.doc_preview, use_column_width=True)
|
| 170 |
-
|
| 171 |
# The file uploader widget manages its own state with key "uploaded_file"
|
| 172 |
st.file_uploader(
|
| 173 |
"Upload Document",
|
|
@@ -190,7 +185,7 @@ def main():
|
|
| 190 |
# Main Interface
|
| 191 |
st.title("📄 Automated Document Verifier")
|
| 192 |
|
| 193 |
-
if st.session_state.get("processed_doc"):
|
| 194 |
col1, col2 = st.columns([1, 2])
|
| 195 |
with col1:
|
| 196 |
st.subheader("Document Preview")
|
|
@@ -207,3 +202,7 @@ def main():
|
|
| 207 |
|
| 208 |
if __name__ == "__main__":
|
| 209 |
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
details = query_gemini(extract_prompt, image_b64)
|
| 140 |
|
| 141 |
# Verify authenticity
|
| 142 |
+
verify_prompt = "Analyze this document for signs of tampering. Provide verification status in short(2 Lines)."
|
| 143 |
verification = query_gemini(verify_prompt, image_b64)
|
| 144 |
|
| 145 |
st.session_state.processed_doc = {
|
|
|
|
| 163 |
# Sidebar Controls
|
| 164 |
with st.sidebar:
|
| 165 |
st.header("Document Controls")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
# The file uploader widget manages its own state with key "uploaded_file"
|
| 167 |
st.file_uploader(
|
| 168 |
"Upload Document",
|
|
|
|
| 185 |
# Main Interface
|
| 186 |
st.title("📄 Automated Document Verifier")
|
| 187 |
|
| 188 |
+
if st.session_state.get("processed_doc") and st.session_state.get("doc_preview"):
|
| 189 |
col1, col2 = st.columns([1, 2])
|
| 190 |
with col1:
|
| 191 |
st.subheader("Document Preview")
|
|
|
|
| 202 |
|
| 203 |
if __name__ == "__main__":
|
| 204 |
main()
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
now the doc preview should be shown above the upload button . it will be shown after uplaidng teh doc .
|