Skip to content

Commit 931657c

Browse files
authored
Merge pull request #3 from icecraft/fix/paddle_not_ret
fix: paddle no ret
2 parents 67528f4 + 3ec17e2 commit 931657c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

magic_doc/libs/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.41"
1+
__version__ = "0.1.42"

magic_doc/model/parallel_paddle.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ def _run_ocr_concurrently(self, chunks):
2626
def run_ocr(chunk, i):
2727
result = []
2828
for idx, img in chunk:
29-
ocr_res = self.models[i](img)
30-
if ocr_res:
31-
result.append((idx, ocr_res))
29+
ocr_res = self.models[i](img) or []
30+
result.append((idx, ocr_res))
3231
return result
3332

3433
with ThreadPoolExecutor(max_workers=len(chunks)) as executor:

magic_doc/model/seq_paddle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __call__(self, params):
1515
"""
1616
results = []
1717
for idx, img in params:
18-
ocr_res = self.model(img)
18+
ocr_res = self.model(img) or []
1919
results.append((idx, ocr_res))
2020

2121
return results

0 commit comments

Comments
 (0)