Arafath10 commited on
Commit
c69582b
·
verified ·
1 Parent(s): 6ea9fac

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -4
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
- time_taken = end_time - start_time
130
- return JSONResponse(content={"content": content, "tables": table_string, "time_taken": time_taken})
 
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__":