Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ from donut import DonutModel
|
|
6 |
from pdf2image import convert_from_path
|
7 |
from io import BytesIO
|
8 |
|
|
|
|
|
9 |
def demo_process(pdf_file):
|
10 |
images = convert_from_path(pdf_file.name)
|
11 |
# output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
@@ -16,5 +18,5 @@ def demo_process(pdf_file):
|
|
16 |
task_name = "SGSInvoice"
|
17 |
task_prompt = f"<s_{task_name}>"
|
18 |
|
19 |
-
demo = gr.Interface(fn=demo_process,inputs=gr.File(label="Upload PDF"),outputs="
|
20 |
demo.launch()
|
|
|
6 |
from pdf2image import convert_from_path
|
7 |
from io import BytesIO
|
8 |
|
9 |
+
|
10 |
+
|
11 |
def demo_process(pdf_file):
|
12 |
images = convert_from_path(pdf_file.name)
|
13 |
# output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
|
|
18 |
task_name = "SGSInvoice"
|
19 |
task_prompt = f"<s_{task_name}>"
|
20 |
|
21 |
+
demo = gr.Interface(fn=demo_process,inputs=gr.File(label="Upload PDF"),outputs="text", title=f"Donut 🍩 demonstration for `{task_name}` task",)
|
22 |
demo.launch()
|