uartimcs commited on
Commit
b215e79
1 Parent(s): b717cd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -4,7 +4,7 @@ import os
4
  import zipfile
5
  from donut import DonutModel
6
 
7
- def process(input_pdf):
8
 
9
  # Conversion of PDF to JPG images
10
  pdf = fitz.open(input_pdf)
@@ -34,7 +34,11 @@ def process(input_pdf):
34
  # model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
35
  # model.eval()
36
 
37
- demo = gr.Interface(fn=process,inputs=gr.File(label="Upload PDF File"),outputs=gr.File(label="Output File"), title=f"Donut 🍩 demonstration task",)
38
- demo.launch()
39
-
40
-
 
 
 
 
 
4
  import zipfile
5
  from donut import DonutModel
6
 
7
+ def demo_process(input_pdf):
8
 
9
  # Conversion of PDF to JPG images
10
  pdf = fitz.open(input_pdf)
 
34
  # model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
35
  # model.eval()
36
 
37
+ iface = gr.Interface(
38
+ fn=demo_process,
39
+ inputs=gr.File(label="Upload PDF File"),
40
+ outputs=gr.File(label="Download ZIP File"),
41
+ title="PDF to Images Converter",
42
+ description="Upload a PDF file and download a ZIP file containing all the pages as images. Host it on huggingface for convenience."
43
+ )
44
+ iface.launch()