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
Branches
1 merge request!41Dev v07
Pipeline #6149 failed with stage
in 3 minutes and 53 seconds
......@@ -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)
train_model(args)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment