Spaces:
Runtime error
Runtime error
upd: answer
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def generate_answer_git(processor, model, image, question):
|
|
52 |
"document-question-answering",
|
53 |
model="andgrt/layoutlmv2-base-uncased_finetuned_docvqa",
|
54 |
)
|
55 |
-
return qa_pipeline(image, question)
|
56 |
# pixel_values, _, _ = preprocess_image(image)
|
57 |
# input_ids = processor(text=question, add_special_tokens=False).input_ids
|
58 |
# input_ids = [processor.tokenizer.cls_token_id] + input_ids
|
|
|
52 |
"document-question-answering",
|
53 |
model="andgrt/layoutlmv2-base-uncased_finetuned_docvqa",
|
54 |
)
|
55 |
+
return qa_pipeline(image, question)[0]["answer"]
|
56 |
# pixel_values, _, _ = preprocess_image(image)
|
57 |
# input_ids = processor(text=question, add_special_tokens=False).input_ids
|
58 |
# input_ids = [processor.tokenizer.cls_token_id] + input_ids
|