fix(python): fix incorrect usage of the exists function

This commit is contained in:
SWHL committed 2024-11-13 08:25:06 +08:00
1 parent f7978c650b
commit 2be4feff82
3 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ logger = get_logger("RapidOCR")
class RapidOCR:
def __init__(self, config_path: Optional[str] = None, **kwargs):
if config_path is not None and Path(config_path).exists:
if config_path is not None and Path(config_path).exists():
config = read_yaml(config_path)
else:
config = read_yaml(DEFAULT_CFG_PATH)
+4 -4
View File
@@ -31,11 +31,11 @@ logger = get_logger("RapidOCR")
class RapidOCR:
def __init__(self, config_path: Optional[str] = None, **kwargs):
config = read_yaml(DEFAULT_CFG_PATH)
config = update_model_path(config)
if config_path is not None and Path(config_path).exists:
if config_path is not None and Path(config_path).exists():
config = read_yaml(config_path)
else:
config = read_yaml(DEFAULT_CFG_PATH)
config = update_model_path(config)
if kwargs:
updater = UpdateParameters()
+4 -4
View File
@@ -31,11 +31,11 @@ logger = get_logger("RapidOCR")
class RapidOCR:
def __init__(self, config_path: Optional[str] = None, **kwargs):
config = read_yaml(DEFAULT_CFG_PATH)
config = update_model_path(config)
if config_path is not None and Path(config_path).exists:
if config_path is not None and Path(config_path).exists():
config = read_yaml(config_path)
else:
config = read_yaml(DEFAULT_CFG_PATH)
config = update_model_path(config)
if kwargs:
updater = UpdateParameters()