openfree commited on
Commit
6fdd5a5
Β·
verified Β·
1 Parent(s): 084672b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -502,8 +502,7 @@ if __name__ == "__main__":
502
  with gr.Column(variant='panel', scale=5):
503
  file_ocr = gr.File(
504
  label="PDF λ˜λŠ” 이미지 νŒŒμΌμ„ μ—…λ‘œλ“œν•˜μ„Έμš”",
505
- file_types=[".pdf", ".png", ".jpeg", ".jpg"],
506
- elem_classes="file-upload"
507
  )
508
 
509
  max_pages_ocr = gr.Slider(
@@ -540,7 +539,15 @@ if __name__ == "__main__":
540
 
541
  with gr.Row():
542
  change_bu_ocr = gr.Button("λ³€ν™˜")
543
- clear_bu_ocr = gr.ClearButton("μ΄ˆκΈ°ν™”")
 
 
 
 
 
 
 
 
544
 
545
  pdf_show_ocr = PDF(
546
  label='PDF 미리보기',
@@ -551,8 +558,10 @@ if __name__ == "__main__":
551
 
552
  # 예제 폴더가 μžˆλ‹€λ©΄ μ‚¬μš© (μ‹€μ œ μ‹€ν–‰ν™˜κ²½μ— 따라 주의)
553
  with gr.Accordion("예제:", open=False):
554
- # __file__ 이 μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” ν™˜κ²½μ—μ„œλŠ” μ˜ˆμ‹œκ°€ λ™μž‘ μ•ˆ ν•  수 있음
555
- example_root = os.path.join(os.path.dirname(__file__), "examples") if "__file__" in globals() else "./examples"
 
 
556
  if os.path.exists(example_root):
557
  gr.Examples(
558
  examples=[
@@ -616,9 +625,5 @@ if __name__ == "__main__":
616
  ]
617
  )
618
 
619
- clear_bu_ocr.add(
620
- [file_ocr, md_ocr, pdf_show_ocr, md_text_ocr, output_file_ocr, is_ocr_ocr]
621
- )
622
-
623
  # 전체 μ•± μ‹€ν–‰
624
  demo.launch(server_name="0.0.0.0", server_port=7860, debug=True, ssr_mode=True)
 
502
  with gr.Column(variant='panel', scale=5):
503
  file_ocr = gr.File(
504
  label="PDF λ˜λŠ” 이미지 νŒŒμΌμ„ μ—…λ‘œλ“œν•˜μ„Έμš”",
505
+ file_types=[".pdf", ".png", ".jpeg", ".jpg"]
 
506
  )
507
 
508
  max_pages_ocr = gr.Slider(
 
539
 
540
  with gr.Row():
541
  change_bu_ocr = gr.Button("λ³€ν™˜")
542
+
543
+ # β˜… ClearButton μˆ˜μ • β˜…
544
+ # 첫 번째 인자 -> clearν•  λŒ€μƒ(μ»΄ν¬λ„ŒνŠΈ),
545
+ # λ²„νŠΌμ— ν‘œμ‹œλ  ν…μŠ€νŠΈλŠ” value="μ΄ˆκΈ°ν™”"
546
+ clear_bu_ocr = gr.ClearButton(
547
+ components=[file_ocr, max_pages_ocr, layout_mode_ocr, language_ocr,
548
+ formula_enable_ocr, is_ocr_ocr, table_enable_ocr],
549
+ value="μ΄ˆκΈ°ν™”"
550
+ )
551
 
552
  pdf_show_ocr = PDF(
553
  label='PDF 미리보기',
 
558
 
559
  # 예제 폴더가 μžˆλ‹€λ©΄ μ‚¬μš© (μ‹€μ œ μ‹€ν–‰ν™˜κ²½μ— 따라 주의)
560
  with gr.Accordion("예제:", open=False):
561
+ example_root = (
562
+ os.path.join(os.path.dirname(__file__), "examples")
563
+ if "__file__" in globals() else "./examples"
564
+ )
565
  if os.path.exists(example_root):
566
  gr.Examples(
567
  examples=[
 
625
  ]
626
  )
627
 
 
 
 
 
628
  # 전체 μ•± μ‹€ν–‰
629
  demo.launch(server_name="0.0.0.0", server_port=7860, debug=True, ssr_mode=True)