fix(rapidocr): fixed issue #405 (#406)

make sure `model_path` is type of `Path`
This commit is contained in:
Elwin authored and GitHub committed 2025-04-25 20:42:16 +08:00
1 parent fbaaaba486
commit a8ea87c4cf
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -121,6 +121,8 @@ class InferSession(abc.ABC):
if not model_path.is_file():
raise FileExistsError(f"{model_path} is not a file.")
return model_path
@abc.abstractmethod
def have_key(self, key: str = "character") -> bool:
pass
+1 -1
View File
@@ -36,7 +36,7 @@ class TorchInferSession(InferSession):
)
)
self._verify_model(model_path)
model_path = self._verify_model(model_path)
all_arch_config = OmegaConf.load(DEFAULT_CFG_PATH)
file_name = model_path.stem