feat: add glm ocr
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from app.services.image_processor import ImageProcessor
|
||||
from app.services.layout_detector import LayoutDetector
|
||||
from app.services.ocr_service import OCRService, MineruOCRService
|
||||
from app.services.ocr_service import OCRService, MineruOCRService, GLMOCRService
|
||||
from app.services.converter import Converter
|
||||
from app.core.config import get_settings
|
||||
|
||||
@@ -57,3 +57,14 @@ def get_mineru_ocr_service() -> MineruOCRService:
|
||||
image_processor=get_image_processor(),
|
||||
paddleocr_vl_url=paddleocr_vl_url,
|
||||
)
|
||||
|
||||
|
||||
def get_glmocr_service() -> GLMOCRService:
|
||||
"""Get a GLM OCR service instance."""
|
||||
settings = get_settings()
|
||||
glm_ocr_url = getattr(settings, "glm_ocr_url", "http://127.0.0.1:8002/v1")
|
||||
return GLMOCRService(
|
||||
vl_server_url=glm_ocr_url,
|
||||
image_processor=get_image_processor(),
|
||||
converter=get_converter(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user