mirror of
https://github.com/allenai/olmocr.git
synced 2025-10-10 07:42:13 +00:00
Crahses
This commit is contained in:
parent
b52ac23073
commit
f114a7fbec
@ -1,7 +1,7 @@
|
|||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
from paddleocr import PPStructureV3
|
from paddleocr import PPStructureV3
|
||||||
|
import torch
|
||||||
|
|
||||||
# Run's paddle paddle as in the docs here: https://huggingface.co/PaddlePaddle/PP-OCRv5_server_det
|
# Run's paddle paddle as in the docs here: https://huggingface.co/PaddlePaddle/PP-OCRv5_server_det
|
||||||
# text_detection_model_name="PP-OCRv5_server_det",
|
# text_detection_model_name="PP-OCRv5_server_det",
|
||||||
@ -32,5 +32,9 @@ def run_paddlepaddle(
|
|||||||
for cur_page_0_indexed, res in enumerate(output):
|
for cur_page_0_indexed, res in enumerate(output):
|
||||||
if cur_page_0_indexed == page_num - 1:
|
if cur_page_0_indexed == page_num - 1:
|
||||||
result = res.markdown["markdown_texts"]
|
result = res.markdown["markdown_texts"]
|
||||||
|
|
||||||
|
# Fixing annoying crashes
|
||||||
|
torch.cuda.empty_cache()
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user