Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,10 +122,10 @@ def read_pdf_online(url):
|
|
| 122 |
reader = PdfReader(f"{uid}-pdf-online.pdf")
|
| 123 |
number_of_pages = len(reader.pages)
|
| 124 |
print(number_of_pages)
|
| 125 |
-
for i in range(number_of_pages):
|
| 126 |
page = reader.pages[i]
|
| 127 |
text = f'{text}\n{page.extract_text()}'
|
| 128 |
-
print(f"PDF_TEXT:: {text}")
|
| 129 |
return text
|
| 130 |
else:
|
| 131 |
text = response.status_code
|
|
@@ -418,7 +418,7 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
| 418 |
if i == " " or i=="," or i=="\n":
|
| 419 |
c +=1
|
| 420 |
print (f'c2:: {c}')
|
| 421 |
-
history.append(("",out))
|
| 422 |
yield "", history,error_box,out
|
| 423 |
json_final=compress_data_json(c,inp,out)
|
| 424 |
json_final = str(json_final)
|
|
|
|
| 122 |
reader = PdfReader(f"{uid}-pdf-online.pdf")
|
| 123 |
number_of_pages = len(reader.pages)
|
| 124 |
print(number_of_pages)
|
| 125 |
+
for i in range(0,number_of_pages):
|
| 126 |
page = reader.pages[i]
|
| 127 |
text = f'{text}\n{page.extract_text()}'
|
| 128 |
+
print(f"PAGE:: {i} -- PDF_TEXT:: {text}")
|
| 129 |
return text
|
| 130 |
else:
|
| 131 |
text = response.status_code
|
|
|
|
| 418 |
if i == " " or i=="," or i=="\n":
|
| 419 |
c +=1
|
| 420 |
print (f'c2:: {c}')
|
| 421 |
+
#history.append(("",out))
|
| 422 |
yield "", history,error_box,out
|
| 423 |
json_final=compress_data_json(c,inp,out)
|
| 424 |
json_final = str(json_final)
|