Spaces:
Sleeping
Sleeping
UPDATE: ThreadPoolExecutor
Browse files- functions.py +1 -1
functions.py
CHANGED
|
@@ -298,7 +298,7 @@ def getTextFromImagePDF(pdfBytes):
|
|
| 298 |
global reader
|
| 299 |
return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
|
| 300 |
allImages = convert_from_bytes(pdfBytes)
|
| 301 |
-
with ThreadPoolExecutor(
|
| 302 |
texts = list(p.map(getText, allImages))
|
| 303 |
return "\n\n\n".join(texts)
|
| 304 |
|
|
|
|
| 298 |
global reader
|
| 299 |
return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
|
| 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 |
|