prithivMLmods commited on
Commit
bea725a
Β·
verified Β·
1 Parent(s): fdc6dfc

updated app

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -286,16 +286,7 @@ def main():
286
  with gr.Column(scale=1):
287
  model_choice = gr.Dropdown(choices=["Logics-Parsing", "Gliese-OCR-7B-Post1.0", "olmOCR-7B-0825"], label="Select Model", value="Logics-Parsing")
288
  file_input = gr.File(label="Upload PDF or Image", file_types=[".pdf", ".jpg", ".jpeg", ".png"], type="filepath")
289
-
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():
@@ -307,6 +298,15 @@ def main():
307
  output_file = gr.File(label='Download Markdown Result', interactive=False)
308
  cost_time = gr.Textbox(label='Time Cost', interactive=False)
309
 
 
 
 
 
 
 
 
 
 
310
  with gr.Column(scale=2):
311
  with gr.Tabs():
312
  with gr.Tab("Markdown Source"):
 
286
  with gr.Column(scale=1):
287
  model_choice = gr.Dropdown(choices=["Logics-Parsing", "Gliese-OCR-7B-Post1.0", "olmOCR-7B-0825"], label="Select Model", value="Logics-Parsing")
288
  file_input = gr.File(label="Upload PDF or Image", file_types=[".pdf", ".jpg", ".jpeg", ".png"], type="filepath")
289
+
 
 
 
 
 
 
 
 
 
290
  image_preview = gr.Image(label="Preview", type="pil", interactive=False, height=320)
291
 
292
  with gr.Row():
 
298
  output_file = gr.File(label='Download Markdown Result', interactive=False)
299
  cost_time = gr.Textbox(label='Time Cost', interactive=False)
300
 
301
+ example_root = "examples"
302
+ if os.path.exists(example_root) and os.path.isdir(example_root):
303
+ example_files = [os.path.join(example_root, f) for f in os.listdir(example_root) if f.endswith(tuple(pdf_suffixes + image_suffixes))]
304
+ if example_files:
305
+ gr.Examples(examples=example_files, inputs=file_input, label="Examples")
306
+
307
+ process_btn = gr.Button("πŸš€ Process Document", variant="primary", size="lg")
308
+ clear_btn = gr.Button("πŸ—‘οΈ Clear All", variant="secondary")
309
+
310
  with gr.Column(scale=2):
311
  with gr.Tabs():
312
  with gr.Tab("Markdown Source"):