andgrt commited on
Commit
489b4ea
·
1 Parent(s): 0dd3755

upd: answer

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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