Skip to content

Commit

Permalink
Convert any non-tuple config argument to str
Browse files Browse the repository at this point in the history
  • Loading branch information
fdraxler committed Mar 28, 2023
1 parent a3c6ed7 commit 092310f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lightning_trainable/launcher/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def run_configuration(self, config: List[Path | str | Tuple[str, object]], num_t
config = config + [("num_threads", num_threads)]
if len(config) > 0:
for value in config:
if isinstance(value, Path):
arguments.append(str(value))
elif isinstance(value, tuple):
if isinstance(value, tuple):
key, value = value
if isinstance(value, type):
value = f"{value.__module__}.{value.__name__}"
arguments.append(f'{key}={dump(value)}')
else:
arguments.append(str(value))

out = None if verbose else subprocess.PIPE
with Popen(['python', '-m', 'lightning_trainable.launcher.fit', *arguments],
Expand Down

0 comments on commit 092310f

Please sign in to comment.