This commit is contained in:
Jake Poznanski 2025-09-19 17:19:12 +00:00
parent b52ac23073
commit f114a7fbec

View File

@ -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",
@ -33,4 +33,8 @@ def run_paddlepaddle(
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