Update main.py
Browse files
main.py
CHANGED
@@ -121,13 +121,12 @@ async def process_pdf(file: UploadFile = File(...), pages_per_chunk: int = 2):
|
|
121 |
file_contents = await file.read()
|
122 |
file_name = file.filename
|
123 |
|
124 |
-
start_time = time.time()
|
125 |
scrape_response_list = await execute_pdfscraper_async(file_contents, file_name, pages_per_chunk)
|
126 |
content, table_string = collect_pdfscraper_response(scrape_response_list)
|
127 |
-
end_time = time.time()
|
128 |
|
129 |
-
|
130 |
-
|
|
|
131 |
|
132 |
# Start the FastAPI app
|
133 |
# if __name__ == "__main__":
|
|
|
121 |
file_contents = await file.read()
|
122 |
file_name = file.filename
|
123 |
|
|
|
124 |
scrape_response_list = await execute_pdfscraper_async(file_contents, file_name, pages_per_chunk)
|
125 |
content, table_string = collect_pdfscraper_response(scrape_response_list)
|
|
|
126 |
|
127 |
+
shutil.rmtree("chunks")
|
128 |
+
print("old chunks removed")
|
129 |
+
return JSONResponse(content={"content": content, "tables": table_string})
|
130 |
|
131 |
# Start the FastAPI app
|
132 |
# if __name__ == "__main__":
|