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