From 092310f08f33af3c08368d51aa374dc6f29a635d Mon Sep 17 00:00:00 2001 From: Felix Draxler Date: Tue, 28 Mar 2023 09:03:52 +0200 Subject: [PATCH] Convert any non-tuple config argument to str --- src/lightning_trainable/launcher/grid.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lightning_trainable/launcher/grid.py b/src/lightning_trainable/launcher/grid.py index 03334a5..086df86 100644 --- a/src/lightning_trainable/launcher/grid.py +++ b/src/lightning_trainable/launcher/grid.py @@ -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],