fix: update paddle-ocr url

This commit is contained in:
liuyuanchuang
2026-02-09 22:26:31 +08:00
parent f64bf25f67
commit a568149164
2 changed files with 8 additions and 8 deletions

View File

@@ -50,12 +50,12 @@ def get_mineru_ocr_service() -> MineruOCRService:
"""Get a MinerOCR service instance."""
settings = get_settings()
api_url = getattr(settings, "miner_ocr_api_url", "http://127.0.0.1:8000/file_parse")
paddleocr_vl_url = getattr(settings, "paddleocr_vl_url", "http://localhost:8001/v1")
glm_ocr_url = getattr(settings, "glm_ocr_url", "http://localhost:8002/v1")
return MineruOCRService(
api_url=api_url,
converter=get_converter(),
image_processor=get_image_processor(),
paddleocr_vl_url=paddleocr_vl_url,
glm_ocr_url=glm_ocr_url,
)

View File

@@ -598,7 +598,7 @@ class MineruOCRService(OCRServiceBase):
api_url: str = "http://127.0.0.1:8000/file_parse",
image_processor: Optional[ImageProcessor] = None,
converter: Optional[Converter] = None,
paddleocr_vl_url: str = "http://localhost:8001/v1",
glm_ocr_url: str = "http://localhost:8002/v1",
layout_detector: Optional[LayoutDetector] = None,
):
"""Initialize Local API service.
@@ -606,13 +606,13 @@ class MineruOCRService(OCRServiceBase):
Args:
api_url: URL of the local file_parse API endpoint.
converter: Optional converter instance for format conversion.
paddleocr_vl_url: URL of the PaddleOCR-VL vLLM server.
glm_ocr_url: URL of the GLM-OCR vLLM server.
"""
self.api_url = api_url
self.image_processor = image_processor
self.converter = converter
self.paddleocr_vl_url = paddleocr_vl_url
self.openai_client = OpenAI(api_key="EMPTY", base_url=paddleocr_vl_url, timeout=3600)
self.glm_ocr_url = glm_ocr_url
self.openai_client = OpenAI(api_key="EMPTY", base_url=glm_ocr_url, timeout=3600)
def _recognize_formula_with_paddleocr_vl(self, image: np.ndarray, prompt: str = "Formula Recognition:") -> str:
"""Recognize formula using PaddleOCR-VL API.