Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ if __name__ == "__main__":
|
|
35 |
parser.add_argument("--pretrained_path", type=str, default="naver-clova-ix/donut-base-finetuned-cord-v2")
|
36 |
parser.add_argument("--port", type=int, default=None)
|
37 |
parser.add_argument("--url", type=str, default=None)
|
38 |
-
parser.add_argument("--sample_img_path", type=str, default="./sample_image_cord_test_receipt_00004.
|
39 |
args, left_argv = parser.parse_known_args()
|
40 |
|
41 |
task_name = args.task
|
@@ -47,8 +47,8 @@ if __name__ == "__main__":
|
|
47 |
example_sample = []
|
48 |
if args.sample_img_path:
|
49 |
image = Image.open(args.sample_img_path)
|
50 |
-
image.save("cord_sample_receipt.
|
51 |
-
example_sample.append("cord_sample_receipt.
|
52 |
|
53 |
pretrained_model = DonutModel.from_pretrained(args.pretrained_path)
|
54 |
pretrained_model.encoder.to(torch.bfloat16)
|
|
|
35 |
parser.add_argument("--pretrained_path", type=str, default="naver-clova-ix/donut-base-finetuned-cord-v2")
|
36 |
parser.add_argument("--port", type=int, default=None)
|
37 |
parser.add_argument("--url", type=str, default=None)
|
38 |
+
parser.add_argument("--sample_img_path", type=str, default="./sample_image_cord_test_receipt_00004.jpg")
|
39 |
args, left_argv = parser.parse_known_args()
|
40 |
|
41 |
task_name = args.task
|
|
|
47 |
example_sample = []
|
48 |
if args.sample_img_path:
|
49 |
image = Image.open(args.sample_img_path)
|
50 |
+
image.save("cord_sample_receipt.jpg")
|
51 |
+
example_sample.append("cord_sample_receipt.jpg")
|
52 |
|
53 |
pretrained_model = DonutModel.from_pretrained(args.pretrained_path)
|
54 |
pretrained_model.encoder.to(torch.bfloat16)
|