浏览代码

fix(magic-pdf): update OCR model selection logic

- Add missing 'else' statement in OCR model selection logic
- Ensure consistent formatting of 'if' statements for better readability
- Remove unnecessary empty line in the 'app.py' file
myhloli 10 月之前
父节点
当前提交
16a0a350ae
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 2 0
      magic_pdf/model/sub_modules/ocr/paddleocr/ppocr_273_mod.py
  2. 1 0
      projects/gradio_app/app.py

+ 2 - 0
magic_pdf/model/sub_modules/ocr/paddleocr/ppocr_273_mod.py

@@ -27,6 +27,8 @@ class ModifiedPaddleOCR(PaddleOCR):
             self.use_onnx = True
             onnx_model_manager = ONNXModelSingleton()
             self.additional_ocr = onnx_model_manager.get_onnx_model(**kwargs)
+        else:
+            self.use_onnx = False
 
     def ocr(self,
             img,

+ 1 - 0
projects/gradio_app/app.py

@@ -183,6 +183,7 @@ def to_pdf(file_path):
 
             return tmp_file_path
 
+
 if __name__ == '__main__':
     with gr.Blocks() as demo:
         gr.HTML(header)