Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,12 @@ from pdf2image import convert_from_path
|
|
7 |
from io import BytesIO
|
8 |
|
9 |
def demo_process(pdf_file):
|
10 |
-
global model, task_name, task_prompt
|
11 |
images = convert_from_path(pdf_file.name)
|
12 |
# output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
13 |
return str(len(images))
|
14 |
|
15 |
-
model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
16 |
-
model.eval()
|
17 |
task_name = "SGSInvoice"
|
18 |
task_prompt = f"<s_{task_name}>"
|
19 |
|
|
|
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]
|
12 |
return str(len(images))
|
13 |
|
14 |
+
# model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
15 |
+
# model.eval()
|
16 |
task_name = "SGSInvoice"
|
17 |
task_prompt = f"<s_{task_name}>"
|
18 |
|