pgray64 commited on
Commit
477daa4
·
verified ·
1 Parent(s): 5425d90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -78,7 +78,7 @@ def get_page_result(raw_result, question):
78
  "question": question,
79
  "answer": raw_result[0]['answer']
80
  },
81
- confidence: raw_result[0]['score']
82
  }
83
  return page_result
84
 
@@ -103,7 +103,7 @@ def qna_pdf_content(image_paths, question, vision_qna, short_circuit_threshold):
103
 
104
  @spaces.GPU
105
  def answer_the_question_for_doc(file_input, question, short_circuit_threshold):
106
- vision_qna = pipeline("document-question-answering", model="impira/layoutlm-document-qa")#, device=0)
107
 
108
  if file_input is not None and question is not None:
109
  print(f"File type: {type(file_input)}")
 
78
  "question": question,
79
  "answer": raw_result[0]['answer']
80
  },
81
+ "confidence": raw_result[0]['score']
82
  }
83
  return page_result
84
 
 
103
 
104
  @spaces.GPU
105
  def answer_the_question_for_doc(file_input, question, short_circuit_threshold):
106
+ vision_qna = pipeline("document-question-answering", model="impira/layoutlm-document-qa", device=0)
107
 
108
  if file_input is not None and question is not None:
109
  print(f"File type: {type(file_input)}")