jinhybr commited on
Commit
6e7cd7f
·
1 Parent(s): 4f2c9c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -3,9 +3,9 @@ import gradio as gr
3
  import torch
4
 
5
  from transformers import DonutProcessor, VisionEncoderDecoderModel
6
-
7
- processor = DonutProcessor.from_pretrained("naver-clova-ix/donut-base-finetuned-cord-v2")
8
- model = VisionEncoderDecoderModel.from_pretrained("naver-clova-ix/donut-base-finetuned-cord-v2")
9
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  model.to(device)
@@ -39,8 +39,8 @@ def process_document(image):
39
 
40
  return processor.token2json(sequence)
41
 
42
- description = "Gradio Demo for Donut, an instance of `VisionEncoderDecoderModel` fine-tuned on SROIE dataset. To use it, simply upload your image and click 'submit', or click one of the examples to load them. Read more at the links below."
43
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
44
 
45
  demo = gr.Interface(
46
  fn=process_document,
 
3
  import torch
4
 
5
  from transformers import DonutProcessor, VisionEncoderDecoderModel
6
+ #naver-clova-ix/donut-base-finetuned-cord-v2
7
+ processor = DonutProcessor.from_pretrained("jinhybr/OCR-Donut-CORD")
8
+ model = VisionEncoderDecoderModel.from_pretrained("jinhybr/OCR-Donut-CORD")
9
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  model.to(device)
 
39
 
40
  return processor.token2json(sequence)
41
 
42
+ description = "Gradio Demo for Donut, an instance of `VisionEncoderDecoderModel` fine-tuned on CORD dataset. To use it, simply upload your image and click 'submit', or click one of the examples to load them. Read more at the links below."
43
+
44
 
45
  demo = gr.Interface(
46
  fn=process_document,