Update app.py
Browse files
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
|
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):
|