优化加载逻辑

This commit is contained in:
Wenjie Zhang 2025-03-14 10:08:51 +08:00
parent 927a7abf99
commit 5ab1b5c1f1

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}")