Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import os
|
|
4 |
import zipfile
|
5 |
from donut import DonutModel
|
6 |
|
7 |
-
def
|
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 |
-
|
38 |
-
|
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()
|