Spaces:
Running
on
Zero
Running
on
Zero
update code
Browse files
app.py
CHANGED
|
@@ -290,18 +290,18 @@ def main():
|
|
| 290 |
process_btn = gr.Button("π Process Document", variant="primary", size="lg")
|
| 291 |
clear_btn = gr.Button("ποΈ Clear All", variant="secondary")
|
| 292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
image_preview = gr.Image(label="Preview", type="pil", interactive=False, height=320)
|
| 294 |
|
| 295 |
with gr.Row():
|
| 296 |
prev_page_btn = gr.Button("β Previous")
|
| 297 |
page_info = gr.HTML('<div class="page-info">No file loaded</div>')
|
| 298 |
next_page_btn = gr.Button("Next βΆ")
|
| 299 |
-
|
| 300 |
-
example_root = "examples"
|
| 301 |
-
if os.path.exists(example_root) and os.path.isdir(example_root):
|
| 302 |
-
example_files = [os.path.join(example_root, f) for f in os.listdir(example_root) if f.endswith(tuple(pdf_suffixes + image_suffixes))]
|
| 303 |
-
if example_files:
|
| 304 |
-
gr.Examples(examples=example_files, inputs=file_input, label="Examples")
|
| 305 |
|
| 306 |
with gr.Accordion("Download & Details", open=False):
|
| 307 |
output_file = gr.File(label='Download Markdown Result', interactive=False)
|
|
|
|
| 290 |
process_btn = gr.Button("π Process Document", variant="primary", size="lg")
|
| 291 |
clear_btn = gr.Button("ποΈ Clear All", variant="secondary")
|
| 292 |
|
| 293 |
+
example_root = "examples"
|
| 294 |
+
if os.path.exists(example_root) and os.path.isdir(example_root):
|
| 295 |
+
example_files = [os.path.join(example_root, f) for f in os.listdir(example_root) if f.endswith(tuple(pdf_suffixes + image_suffixes))]
|
| 296 |
+
if example_files:
|
| 297 |
+
gr.Examples(examples=example_files, inputs=file_input, label="Examples")
|
| 298 |
+
|
| 299 |
image_preview = gr.Image(label="Preview", type="pil", interactive=False, height=320)
|
| 300 |
|
| 301 |
with gr.Row():
|
| 302 |
prev_page_btn = gr.Button("β Previous")
|
| 303 |
page_info = gr.HTML('<div class="page-info">No file loaded</div>')
|
| 304 |
next_page_btn = gr.Button("Next βΆ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
with gr.Accordion("Download & Details", open=False):
|
| 307 |
output_file = gr.File(label='Download Markdown Result', interactive=False)
|