refactor: add tip when model_dict is None

Closes #628
This commit is contained in:
SWHL committed 2026-01-28 22:11:01 +08:00
1 parent 402aadb121
commit 58bf4f81cc
1 file changed
+6 -1
+6 -1
View File
@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: liekkaskono@163.com
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: