feat(ml): multilingual ocr (#23527)

* handle other languages in ml server

* add variants to model selector

* no need to override path

* unused import
This commit is contained in:
Mert
2025-11-06 12:58:41 -05:00
committed by GitHub
parent a4ae86ce29
commit 6913697ad1
5 changed files with 22 additions and 6 deletions

View File

@@ -20,8 +20,8 @@ class TextRecognitionOutput(TypedDict):
# RapidOCR expects `engine_type`, `lang_type`, and `font_path` to be attributes
class OcrOptions(dict[str, Any]):
def __init__(self, **options: Any) -> None:
def __init__(self, lang_type: LangRec | None = None, **options: Any) -> None:
super().__init__(**options)
self.engine_type = EngineType.ONNXRUNTIME
self.lang_type = LangRec.CH
self.lang_type = lang_type
self.font_path = None