mp-02 commited on
Commit
9c725ef
·
verified ·
1 Parent(s): 3ba1c73

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +3 -3
inference.py CHANGED
@@ -4,9 +4,9 @@ from transformers import LayoutLMv3TokenizerFast, LayoutLMv3Processor, LayoutLMv
4
  from PIL import Image, ImageDraw, ImageFont
5
  from utils import OCR, unnormalize_box
6
 
7
- tokenizer = LayoutLMv3TokenizerFast.from_pretrained("mp-02/layoutlmv3-finetuned-cord-sroie", apply_ocr=False)
8
- processor = LayoutLMv3Processor.from_pretrained("mp-02/layoutlmv3-finetuned-cord-sroie", apply_ocr=False)
9
- model = LayoutLMv3ForTokenClassification.from_pretrained("mp-02/layoutlmv3-finetuned-cord-sroie")
10
 
11
  id2label = model.config.id2label
12
  label2id = model.config.label2id
 
4
  from PIL import Image, ImageDraw, ImageFont
5
  from utils import OCR, unnormalize_box
6
 
7
+ tokenizer = LayoutLMv3TokenizerFast.from_pretrained("mp-02/layoutlmv3-base-cord-sroie", apply_ocr=False)
8
+ processor = LayoutLMv3Processor.from_pretrained("mp-02/layoutlmv3-base-cord-sroie", apply_ocr=False)
9
+ model = LayoutLMv3ForTokenClassification.from_pretrained("mp-02/layoutlmv3-base-cord-sroie")
10
 
11
  id2label = model.config.id2label
12
  label2id = model.config.label2id