Spaces:
Sleeping
Sleeping
Update cord_inference.py
Browse files- cord_inference.py +3 -3
cord_inference.py
CHANGED
@@ -49,9 +49,9 @@ label_list = [
|
|
49 |
id2label = dict(enumerate(label_list))
|
50 |
label2id = {v: k for k, v in enumerate(label_list)}
|
51 |
|
52 |
-
tokenizer = LayoutLMv3TokenizerFast.from_pretrained("mp-02/layoutlmv3-finetuned-
|
53 |
-
processor = LayoutLMv3Processor.from_pretrained("mp-02/layoutlmv3-finetuned-
|
54 |
-
model = LayoutLMv3ForTokenClassification.from_pretrained("mp-02/layoutlmv3-finetuned-
|
55 |
|
56 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
57 |
model.to(device)
|
|
|
49 |
id2label = dict(enumerate(label_list))
|
50 |
label2id = {v: k for k, v in enumerate(label_list)}
|
51 |
|
52 |
+
tokenizer = LayoutLMv3TokenizerFast.from_pretrained("mp-02/layoutlmv3-finetuned-cord", apply_ocr=False)
|
53 |
+
processor = LayoutLMv3Processor.from_pretrained("mp-02/layoutlmv3-finetuned-cord", apply_ocr=False)
|
54 |
+
model = LayoutLMv3ForTokenClassification.from_pretrained("mp-02/layoutlmv3-finetuned-cord")
|
55 |
|
56 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
57 |
model.to(device)
|