Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,9 @@ def demo_process(pdf_path):
|
|
10 |
global model, task_prompt, task_name
|
11 |
input_img_list = convert_from_path(pdf_path.name)
|
12 |
input_img = input_img_list[0]
|
13 |
-
|
14 |
-
|
|
|
15 |
|
16 |
parser = argparse.ArgumentParser()
|
17 |
parser.add_argument("--task", type=str, default="SGSInvoice")
|
@@ -22,5 +23,5 @@ task_prompt = f"<s_{task_name}>"
|
|
22 |
|
23 |
model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
24 |
model.eval()
|
25 |
-
demo = gr.Interface(fn=demo_process,inputs=gr.File(label="Upload PDF"),outputs="
|
26 |
demo.launch()
|
|
|
10 |
global model, task_prompt, task_name
|
11 |
input_img_list = convert_from_path(pdf_path.name)
|
12 |
input_img = input_img_list[0]
|
13 |
+
return type(input_img)
|
14 |
+
# output = model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
15 |
+
# return output
|
16 |
|
17 |
parser = argparse.ArgumentParser()
|
18 |
parser.add_argument("--task", type=str, default="SGSInvoice")
|
|
|
23 |
|
24 |
model = DonutModel.from_pretrained("uartimcs/donut-invoice-extract")
|
25 |
model.eval()
|
26 |
+
demo = gr.Interface(fn=demo_process,inputs=gr.File(label="Upload PDF"),outputs="text", title=f"Donut 🍩 demonstration for `{task_name}` task",)
|
27 |
demo.launch()
|