From dd7f6781f6236e0ab7acad668d412ef27c050287 Mon Sep 17 00:00:00 2001 From: myhloli Date: Tue, 10 Dec 2024 18:11:59 +0800 Subject: [PATCH] fix(magic_pdf): disable PaddlePaddle signal handler - Import paddle module and disable its signal handler to prevent interference with other components - This change addresses potential conflicts between PaddlePaddle and other libraries or system signals --- magic_pdf/model/doc_analyze_by_custom_model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/magic_pdf/model/doc_analyze_by_custom_model.py b/magic_pdf/model/doc_analyze_by_custom_model.py index 38605357..ec46d867 100644 --- a/magic_pdf/model/doc_analyze_by_custom_model.py +++ b/magic_pdf/model/doc_analyze_by_custom_model.py @@ -5,6 +5,10 @@ import fitz import numpy as np from loguru import logger +# 关闭paddle的信号处理 +import paddle +paddle.disable_signal_handler() + os.environ['NO_ALBUMENTATIONS_UPDATE'] = '1' # 禁止albumentations检查更新 os.environ['YOLO_VERBOSE'] = 'False' # disable yolo logger