Skip to content
Snippets Groups Projects
Commit b8d24205 authored by Michał Marcińczuk's avatar Michał Marcińczuk
Browse files

Pass list of paths.

parent e4006d1a
No related branches found
No related tags found
1 merge request!41Dev v07
Pipeline #6149 failed
......@@ -22,7 +22,12 @@ def load_configurations(path: str) -> Dict[str, Union[str, List[str]]]:
def generate_cmds_list(params: Dict[str, Union[str, List[str]]]) -> List[List[str]]:
lists = [[]]
for key, values in params.items():
if isinstance(values, list):
if key.endswith("/list"):
key = key[:-5]
for ll in lists:
for value in values:
ll.extend([f"--{key}", value])
elif isinstance(values, list):
new_lists = []
for value in values:
for ll in lists:
......@@ -33,6 +38,7 @@ def generate_cmds_list(params: Dict[str, Union[str, List[str]]]) -> List[List[st
ll.append(f"--{key}")
if values is not None:
ll.append(str(values))
print(lists)
return lists
......@@ -57,7 +63,4 @@ if __name__ == '__main__':
for cmd in cmds:
args = parser.parse_args(cmd)
print(args)
try:
train_model(args)
except KeyError as error:
print(error)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment