Skip to content

Commit 6537d4c

Browse files
authored
AC: fix prefix path if provided file (#2936)
1 parent f1b9479 commit 6537d4c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/config/config_reader.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
'saved_model_dir',
100100
'params'
101101
]
102+
ALLOW_FILE_OR_DIR = ['models']
102103

103104

104105
class ConfigReader:
@@ -788,10 +789,14 @@ def merge_entry_paths(keys, value, args, value_id=0):
788789
continue
789790

790791
selected_argument = select_arg_path(args[arg_candidate], value_id, argument)
792+
prefix_path = selected_argument
791793
if not selected_argument.is_dir():
792-
raise ConfigError('argument: {} should be a directory'.format(argument))
794+
if argument in ALLOW_FILE_OR_DIR:
795+
prefix_path = selected_argument.parent
796+
else:
797+
raise ConfigError('argument: {} should be a directory'.format(argument))
793798

794-
if (selected_argument / config_path).exists():
799+
if (prefix_path / config_path).exists():
795800
break
796801
value[field] = selected_argument / config_path if selected_argument is not None else config_path
797802

0 commit comments

Comments
 (0)