Commit 16a0a350 authored by myhloli's avatar myhloli
Browse files

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
parent 04febf52
...@@ -27,6 +27,8 @@ class ModifiedPaddleOCR(PaddleOCR): ...@@ -27,6 +27,8 @@ class ModifiedPaddleOCR(PaddleOCR):
self.use_onnx = True self.use_onnx = True
onnx_model_manager = ONNXModelSingleton() onnx_model_manager = ONNXModelSingleton()
self.additional_ocr = onnx_model_manager.get_onnx_model(**kwargs) self.additional_ocr = onnx_model_manager.get_onnx_model(**kwargs)
else:
self.use_onnx = False
def ocr(self, def ocr(self,
img, img,
......
...@@ -183,6 +183,7 @@ def to_pdf(file_path): ...@@ -183,6 +183,7 @@ def to_pdf(file_path):
return tmp_file_path return tmp_file_path
if __name__ == '__main__': if __name__ == '__main__':
with gr.Blocks() as demo: with gr.Blocks() as demo:
gr.HTML(header) gr.HTML(header)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment