navid72m commited on
Commit
d104a1b
1 Parent(s): 88d59c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -77,9 +77,9 @@ def answer_question_from_pdf(pdf_text, question):
77
  # This function should return the answer to the question based on the PDF content
78
  # Here we just return a mock response
79
 
80
- answer = query( {"inputs": "Based on this content: " + pdf_text+" The Question is: "+ question + " Provide the answer with max lenghth of about 100",})
81
  answer = answer[0]["generated_text"]
82
- answer = answer[answer.find("Answer"):]
83
  return answer
84
  # Function to extract text from PDF
85
  def extract_text_from_pdf(pdf_file):
 
77
  # This function should return the answer to the question based on the PDF content
78
  # Here we just return a mock response
79
 
80
+ answer = query( {"inputs": "Based on this content: " + pdf_text+" The Question is: "+ question + " Provide the answer with max lenghth of about 500",})
81
  answer = answer[0]["generated_text"]
82
+ answer = answer[answer.find("Answer")+6:]
83
  return answer
84
  # Function to extract text from PDF
85
  def extract_text_from_pdf(pdf_file):