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