Spaces:
Build error
Build error
UPDATE: ThreadPoolExecutor
Browse files- functions.py +1 -1
functions.py
CHANGED
|
@@ -298,7 +298,7 @@ def getText(image):
|
|
| 298 |
|
| 299 |
def getTextFromImagePDF(pdfBytes):
|
| 300 |
allImages = convert_from_bytes(pdfBytes)
|
| 301 |
-
with ThreadPoolExecutor() as p:
|
| 302 |
texts = list(p.map(getText, allImages))
|
| 303 |
return "\n\n\n".join(texts)
|
| 304 |
|
|
|
|
| 298 |
|
| 299 |
def getTextFromImagePDF(pdfBytes):
|
| 300 |
allImages = convert_from_bytes(pdfBytes)
|
| 301 |
+
with ThreadPoolExecutor(max_workers = 10) as p:
|
| 302 |
texts = list(p.map(getText, allImages))
|
| 303 |
return "\n\n\n".join(texts)
|
| 304 |
|