From 23e2160668c7b2288b853f0b1a2262d027549b6b Mon Sep 17 00:00:00 2001 From: liuyuanchuang Date: Sat, 7 Feb 2026 09:11:43 +0800 Subject: [PATCH] fix: get setting param --- app/core/config.py | 6 +++++- app/services/ocr_service.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 322c31e..d3fecd7 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -30,8 +30,12 @@ class Settings(BaseSettings): # GLM OCR Settings glm_ocr_url: str = "http://127.0.0.1:8002/v1" + # padding ratio + is_padding: bool = False + padding_ratio: float = 0.15 + # Model Paths - pp_doclayout_model_dir: Optional[str] = "/home/yoge/.cache/modelscope/hub/models/PaddlePaddle/PP-DocLayoutV2" + pp_doclayout_model_dir: Optional[str] = "/home/yoge/.cache/modelscope/hub/models/PaddlePaddle/PP-DocLayoutV3" # Image Processing max_image_size_mb: int = 10 diff --git a/app/services/ocr_service.py b/app/services/ocr_service.py index 3b488df..6734695 100644 --- a/app/services/ocr_service.py +++ b/app/services/ocr_service.py @@ -660,7 +660,7 @@ class MineruOCRService(OCRServiceBase): Dict with 'markdown', 'latex', 'mathml' keys. """ try: - if self.image_processor and get_settings().is_padding: + if self.image_processor and settings.is_padding: image = self.image_processor.add_padding(image) # Convert numpy array to image bytes