fix: update paddle-ocr url
This commit is contained in:
@@ -50,12 +50,12 @@ def get_mineru_ocr_service() -> MineruOCRService:
|
|||||||
"""Get a MinerOCR service instance."""
|
"""Get a MinerOCR service instance."""
|
||||||
settings = get_settings()
|
settings = get_settings()
|
||||||
api_url = getattr(settings, "miner_ocr_api_url", "http://127.0.0.1:8000/file_parse")
|
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(
|
return MineruOCRService(
|
||||||
api_url=api_url,
|
api_url=api_url,
|
||||||
converter=get_converter(),
|
converter=get_converter(),
|
||||||
image_processor=get_image_processor(),
|
image_processor=get_image_processor(),
|
||||||
paddleocr_vl_url=paddleocr_vl_url,
|
glm_ocr_url=glm_ocr_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ class MineruOCRService(OCRServiceBase):
|
|||||||
api_url: str = "http://127.0.0.1:8000/file_parse",
|
api_url: str = "http://127.0.0.1:8000/file_parse",
|
||||||
image_processor: Optional[ImageProcessor] = None,
|
image_processor: Optional[ImageProcessor] = None,
|
||||||
converter: Optional[Converter] = 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,
|
layout_detector: Optional[LayoutDetector] = None,
|
||||||
):
|
):
|
||||||
"""Initialize Local API service.
|
"""Initialize Local API service.
|
||||||
@@ -606,13 +606,13 @@ class MineruOCRService(OCRServiceBase):
|
|||||||
Args:
|
Args:
|
||||||
api_url: URL of the local file_parse API endpoint.
|
api_url: URL of the local file_parse API endpoint.
|
||||||
converter: Optional converter instance for format conversion.
|
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.api_url = api_url
|
||||||
self.image_processor = image_processor
|
self.image_processor = image_processor
|
||||||
self.converter = converter
|
self.converter = converter
|
||||||
self.paddleocr_vl_url = paddleocr_vl_url
|
self.glm_ocr_url = glm_ocr_url
|
||||||
self.openai_client = OpenAI(api_key="EMPTY", base_url=paddleocr_vl_url, timeout=3600)
|
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:
|
def _recognize_formula_with_paddleocr_vl(self, image: np.ndarray, prompt: str = "Formula Recognition:") -> str:
|
||||||
"""Recognize formula using PaddleOCR-VL API.
|
"""Recognize formula using PaddleOCR-VL API.
|
||||||
|
|||||||
Reference in New Issue
Block a user