mirror of
https://github.com/RapidAI/RapidOCR.git
synced 2026-11-10 21:10:55 +08:00
chore(rapidocr_onnxruntime): change read_yaml order (#251)
fisrt check the input args if the param named 'config_path' exists, use 'config_path' first. if it is not exists, use the default one named 'DEFAULT_CFG_PATH'
This commit is contained in:
1 parent
0de20668af
commit
f7978c650b
1 file changed
+3
-3
@@ -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:
|
||||
config = read_yaml(config_path)
|
||||
else:
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
config = update_model_path(config)
|
||||
|
||||
if kwargs:
|
||||
updater = UpdateParameters()
|
||||
|
||||
Reference in new issue
Block a user