Rauhan commited on
Commit
4581a9c
·
1 Parent(s): a1f9f6b

UPDATE: ThreadPoolExecutor

Browse files
Files changed (1) hide show
  1. functions.py +1 -1
functions.py CHANGED
@@ -299,7 +299,7 @@ def getTextFromImagePDF(pdfBytes):
299
  global reader
300
  return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
301
  allImages = convert_from_bytes(pdfBytes)
302
- with ThreadPoolExecutor() as p:
303
  texts = list(p.map(getText, allImages))
304
  return "\n\n\n".join(texts)
305
 
 
299
  global reader
300
  return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
301
  allImages = convert_from_bytes(pdfBytes)
302
+ with ThreadPoolExecutor(max_workers = 5) as p:
303
  texts = list(p.map(getText, allImages))
304
  return "\n\n\n".join(texts)
305