Ammar-alhaj-ali commited on
Commit
155e281
1 Parent(s): a8358f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -8,12 +8,13 @@ os.system('pip install -q pytesseract')
8
 
9
  import gradio as gr
10
  import numpy as np
11
- from transformers import LayoutLMv3Processor, LayoutLMv3ForTokenClassification
12
  from datasets import load_dataset
13
  from PIL import Image, ImageDraw, ImageFont
14
 
15
- processor = LayoutLMv2Processor.from_pretrained("microsoft/layoutlmv3-base-uncased")
16
- model = LayoutLMv2ForTokenClassification.from_pretrained("nielsr/layoutlmv3-finetuned-funsd")
 
17
 
18
  # load image example
19
  dataset = load_dataset("nielsr/funsd", split="test")
 
8
 
9
  import gradio as gr
10
  import numpy as np
11
+
12
  from datasets import load_dataset
13
  from PIL import Image, ImageDraw, ImageFont
14
 
15
+ from transformers import AutoProcessor, AutoModelForTokenClassification
16
+ processor = AutoProcessor.from_pretrained("Ammar-alhaj-ali/LayoutLMv3-Fine-Tuning-FUNSD")
17
+ model = AutoModelForTokenClassification.from_pretrained("Ammar-alhaj-ali/LayoutLMv3-Fine-Tuning-FUNSD")
18
 
19
  # load image example
20
  dataset = load_dataset("nielsr/funsd", split="test")