Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -461,10 +461,8 @@ history=[
|
|
| 461 |
|
| 462 |
def get_pdf_text(pdf_docs):
|
| 463 |
text = ""
|
| 464 |
-
for pdf in pdf_docs:
|
| 465 |
-
|
| 466 |
-
pdf_byteio.seek(0)
|
| 467 |
-
pdf_reader = PdfReader(pdf_byteio)
|
| 468 |
for page in pdf_reader.pages:
|
| 469 |
text += page.extract_text()
|
| 470 |
return text
|
|
@@ -513,8 +511,10 @@ def user_input(user_question):
|
|
| 513 |
pdfans = chain(
|
| 514 |
{"input_documents":docs, "question": user_question}
|
| 515 |
, return_only_outputs=True)
|
| 516 |
-
|
| 517 |
-
|
|
|
|
|
|
|
| 518 |
|
| 519 |
url = "https://y39t47-8080.csb.app/search"
|
| 520 |
|
|
|
|
| 461 |
|
| 462 |
def get_pdf_text(pdf_docs):
|
| 463 |
text = ""
|
| 464 |
+
for pdf in pdf_docs:
|
| 465 |
+
pdf_reader = PdfReader(pdf)
|
|
|
|
|
|
|
| 466 |
for page in pdf_reader.pages:
|
| 467 |
text += page.extract_text()
|
| 468 |
return text
|
|
|
|
| 511 |
pdfans = chain(
|
| 512 |
{"input_documents":docs, "question": user_question}
|
| 513 |
, return_only_outputs=True)
|
| 514 |
+
|
| 515 |
+
pdfof = pdfans["output_text"]
|
| 516 |
+
|
| 517 |
+
return pdfof
|
| 518 |
|
| 519 |
url = "https://y39t47-8080.csb.app/search"
|
| 520 |
|