Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -777,21 +777,14 @@ with gr.Blocks(title="PDF Layout Extractor") as demo:
|
|
| 777 |
outputs=[output_md, output_gallery, output_pdf, status_msg]
|
| 778 |
)
|
| 779 |
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
|
| 784 |
# --------------------------------------------------------------------------------
|
| 785 |
# Integrate Gradio with FastAPI
|
| 786 |
# --------------------------------------------------------------------------------
|
| 787 |
# Mount Gradio at /gradio path (this ensures static files work correctly)
|
| 788 |
-
app = gr.mount_gradio_app(
|
| 789 |
-
app,
|
| 790 |
-
demo,
|
| 791 |
-
path="/gradio",
|
| 792 |
-
allowed_paths=["./output", "./uploads"],
|
| 793 |
-
ssr_mode=False
|
| 794 |
-
)
|
| 795 |
|
| 796 |
# Redirect root to Gradio interface
|
| 797 |
@app.get("/", response_class=HTMLResponse, include_in_schema=False)
|
|
|
|
| 777 |
outputs=[output_md, output_gallery, output_pdf, status_msg]
|
| 778 |
)
|
| 779 |
|
| 780 |
+
# Enable queueing for better stability and performance on Spaces
|
| 781 |
+
demo.queue()
|
|
|
|
| 782 |
|
| 783 |
# --------------------------------------------------------------------------------
|
| 784 |
# Integrate Gradio with FastAPI
|
| 785 |
# --------------------------------------------------------------------------------
|
| 786 |
# Mount Gradio at /gradio path (this ensures static files work correctly)
|
| 787 |
+
app = gr.mount_gradio_app(app, demo, path="/gradio")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 788 |
|
| 789 |
# Redirect root to Gradio interface
|
| 790 |
@app.get("/", response_class=HTMLResponse, include_in_schema=False)
|