Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -275,6 +275,25 @@ def process_pdf(pdf_file):
|
|
| 275 |
except Exception as e:
|
| 276 |
return None, f"❌ Error: {str(e)}"
|
| 277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
# ---------------------------------------------------------
|
| 279 |
# 5. GRADIO INTERFACE
|
| 280 |
# ---------------------------------------------------------
|
|
@@ -287,7 +306,7 @@ iface = gr.Interface(
|
|
| 287 |
],
|
| 288 |
title="LayoutLMv3 PDF Parser",
|
| 289 |
description="Upload a document to extract Questions, Options, and Passages into structured JSON.",
|
| 290 |
-
|
| 291 |
)
|
| 292 |
|
| 293 |
if __name__ == "__main__":
|
|
|
|
| 275 |
except Exception as e:
|
| 276 |
return None, f"❌ Error: {str(e)}"
|
| 277 |
|
| 278 |
+
# ---------------------------------------------------------
|
| 279 |
+
# 5. GRADIO INTERFACE
|
| 280 |
+
# ---------------------------------------------------------
|
| 281 |
+
# iface = gr.Interface(
|
| 282 |
+
# fn=process_pdf,
|
| 283 |
+
# inputs=gr.File(label="Upload PDF", file_types=[".pdf"]),
|
| 284 |
+
# outputs=[
|
| 285 |
+
# gr.File(label="Download JSON Output"),
|
| 286 |
+
# gr.Textbox(label="Status Log")
|
| 287 |
+
# ],
|
| 288 |
+
# title="LayoutLMv3 PDF Parser",
|
| 289 |
+
# description="Upload a document to extract Questions, Options, and Passages into structured JSON.",
|
| 290 |
+
# allow_flagging="never"
|
| 291 |
+
# )
|
| 292 |
+
|
| 293 |
+
# if __name__ == "__main__":
|
| 294 |
+
# iface.launch()
|
| 295 |
+
|
| 296 |
+
|
| 297 |
# ---------------------------------------------------------
|
| 298 |
# 5. GRADIO INTERFACE
|
| 299 |
# ---------------------------------------------------------
|
|
|
|
| 306 |
],
|
| 307 |
title="LayoutLMv3 PDF Parser",
|
| 308 |
description="Upload a document to extract Questions, Options, and Passages into structured JSON.",
|
| 309 |
+
flagging_mode="never" # <--- This is the fix (renamed from allow_flagging)
|
| 310 |
)
|
| 311 |
|
| 312 |
if __name__ == "__main__":
|