Respect custom timestamps passed to ns-train (#778)

When using `ns-train` as part of a pipeline, it's convenient for the output directory to be deterministic. This should be achievable by passing the `--timestamp` argument to `ns-train`, but that argument is currently being overwritten. This PR fixes the logic to respect a custom user-provided `--timestamp` value.
This commit is contained in:
Kyle Corbitt authored and GitHub committed 2022-10-14 18:55:01 -07:00
1 parent d71c05f256
commit 006008b72f
1 file changed
+2 -1
+2 -1
View File
@@ -231,7 +231,8 @@ class Config(PrintableConfig):
def set_timestamp(self) -> None:
"""Dynamically set the experiment timestamp"""
self.timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S")
if self.timestamp == "{timestamp}":
self.timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S")
def set_experiment_name(self) -> None:
"""Dynamically set the experiment name"""