Skip to content

Commit 58bf4f8

Browse files
committed
refactor: add tip when model_dict is None
Closes #628
1 parent 402aadb commit 58bf4f8

File tree

1 file changed

+6
-1
lines changed
  • python/rapidocr/inference_engine

1 file changed

+6
-1
lines changed

python/rapidocr/inference_engine/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- encoding: utf-8 -*-
1+
# -*- encoding: utf-8 -*-
22
# @Author: SWHL
33
# @Contact: liekkaskono@163.com
44
import abc
@@ -113,6 +113,11 @@ def get_model_url(cls, file_info: FileInfo) -> Dict[str, str]:
113113
cls.model_info, f"{engine_type}.{ocr_version}.{task_type}"
114114
)
115115

116+
if not model_dict:
117+
raise ValueError(
118+
f"Unsupported configuration: {engine_type}.{ocr_version}.{task_type}.{model_type}"
119+
)
120+
116121
# 优先查找 server 模型
117122
if model_type == ModelType.SERVER.value:
118123
for k in model_dict:

0 commit comments

Comments
 (0)