From f114a7fbecaa3908a852185b8091c69b1e33e3a4 Mon Sep 17 00:00:00 2001 From: Jake Poznanski Date: Fri, 19 Sep 2025 17:19:12 +0000 Subject: [PATCH] Crahses --- olmocr/bench/runners/run_paddlepaddle.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/olmocr/bench/runners/run_paddlepaddle.py b/olmocr/bench/runners/run_paddlepaddle.py index 2d4bde1..cf4653a 100644 --- a/olmocr/bench/runners/run_paddlepaddle.py +++ b/olmocr/bench/runners/run_paddlepaddle.py @@ -1,7 +1,7 @@ from threading import Lock from paddleocr import PPStructureV3 - +import torch # 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", @@ -32,5 +32,9 @@ def run_paddlepaddle( for cur_page_0_indexed, res in enumerate(output): if cur_page_0_indexed == page_num - 1: result = res.markdown["markdown_texts"] + + # Fixing annoying crashes + torch.cuda.empty_cache() + gc.collect() return result