Merge pull request #74 from xerrors/update-ocr-loading

优化加载逻辑
This commit is contained in:
Wenjie Zhang 2025-03-14 10:10:48 +08:00 committed by GitHub
commit 584bfd30f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,8 +118,6 @@ class OCRPlugin:
:param pdf_path: PDF文件路径
:return: 提取的文本
"""
if self.ocr is None:
self.load_model()
if not os.path.exists(pdf_path):
raise FileNotFoundError(f"PDF file not found: {pdf_path}")