uartimcs commited on
Commit
414f38b
·
verified ·
1 Parent(s): 5a10adf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -5,10 +5,9 @@ from donut import DonutModel
5
  from pdf2image import convert_from_path
6
 
7
  def demo_process(pdf_file):
8
- # images = convert_from_path(pdf_file)
9
  # output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
10
- return pdf_file.name
11
-
12
  # model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
13
  # model.eval()
14
  task_name = "SGSInvoice"
 
5
  from pdf2image import convert_from_path
6
 
7
  def demo_process(pdf_file):
8
+ images = convert_from_path(pdf_file.name)
9
  # output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
10
+ return str(len(images))
 
11
  # model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
12
  # model.eval()
13
  task_name = "SGSInvoice"