Skip to content

Commit

Permalink
Merge pull request #3 from icecraft/fix/paddle_not_ret
Browse files Browse the repository at this point in the history
fix: paddle no ret
  • Loading branch information
icecraft authored Jul 1, 2024
2 parents 67528f4 + 3ec17e2 commit 931657c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion magic_doc/libs/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.41"
__version__ = "0.1.42"
5 changes: 2 additions & 3 deletions magic_doc/model/parallel_paddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def _run_ocr_concurrently(self, chunks):
def run_ocr(chunk, i):
result = []
for idx, img in chunk:
ocr_res = self.models[i](img)
if ocr_res:
result.append((idx, ocr_res))
ocr_res = self.models[i](img) or []
result.append((idx, ocr_res))
return result

with ThreadPoolExecutor(max_workers=len(chunks)) as executor:
Expand Down
2 changes: 1 addition & 1 deletion magic_doc/model/seq_paddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __call__(self, params):
"""
results = []
for idx, img in params:
ocr_res = self.model(img)
ocr_res = self.model(img) or []
results.append((idx, ocr_res))

return results

0 comments on commit 931657c

Please sign in to comment.