Spaces:
Sleeping
Sleeping
UPDATE: ThreadPoolExecutor
Browse files- 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 |
|