Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import argparse
|
3 |
import torch
|
4 |
-
from PIL import Image
|
5 |
from donut import DonutModel
|
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
|
13 |
# output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
14 |
-
return str(len(
|
15 |
|
16 |
# model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
17 |
# model.eval()
|
|
|
1 |
import gradio as gr
|
2 |
import argparse
|
3 |
import torch
|
|
|
4 |
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 str(len([1,2,3,4,5]))
|
11 |
|
12 |
# model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
13 |
# model.eval()
|