Spaces:
Running
Running
TusharGoel
commited on
Commit
·
af50898
1
Parent(s):
b339a29
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, LayoutLMv3ImageProcessor
|
3 |
|
4 |
model_name = "TusharGoel/LiLT-Document-QA"
|
5 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name, apply_ocr = True)
|
6 |
image_processor = LayoutLMv3ImageProcessor()
|
7 |
|
8 |
-
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
9 |
model.eval()
|
10 |
|
11 |
def qna(image, question):
|
|
|
2 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, LayoutLMv3ImageProcessor
|
3 |
|
4 |
model_name = "TusharGoel/LiLT-Document-QA"
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, apply_ocr = True, revision="3d488d3d0b11abbe0d4ee5b44e7478861cf3a072")
|
6 |
image_processor = LayoutLMv3ImageProcessor()
|
7 |
|
8 |
+
model = AutoModelForQuestionAnswering.from_pretrained(model_name, revision="3d488d3d0b11abbe0d4ee5b44e7478861cf3a072")
|
9 |
model.eval()
|
10 |
|
11 |
def qna(image, question):
|