Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

refactor: add tip when model_dict is None

SWHL58bf4f81cc83
diff --git a/python/rapidocr/inference_engine/base.py b/python/rapidocr/inference_engine/base.py
index aa39e4b..aacb79a 100644
--- a/python/rapidocr/inference_engine/base.py
+++ b/python/rapidocr/inference_engine/base.py
@@ -1,4 +1,4 @@
- # -*- encoding: utf-8 -*-
+# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: [email protected]
import abc
@@ -113,6 +113,11 @@ class InferSession(abc.ABC):
cls.model_info, f"{engine_type}.{ocr_version}.{task_type}"
)
+ if not model_dict:
+ raise ValueError(
+ f"Unsupported configuration: {engine_type}.{ocr_version}.{task_type}.{model_type}"
+ )
+
# δΌ˜ε…ˆζŸ₯ζ‰Ύ server ζ¨‘εž‹
if model_type == ModelType.SERVER.value:
for k in model_dict: