From fda47156ec66adf629c819a055fed87f996c196a Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 28 Feb 2023 01:08:07 +0000 Subject: [PATCH] oops --- src/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.py b/src/utils.py index 8e87eb6..3b081db 100755 --- a/src/utils.py +++ b/src/utils.py @@ -543,7 +543,7 @@ class TrainingState(): print("Removing", path) os.remove(path) - def parse(self, line, verbose=False, buffer_size=8, progress=None ): + def parse(self, line, verbose=False, buffer_size=8, keep_x_past_datasets=0, progress=None ): self.buffer.append(f'{line}') # rip out iteration info @@ -646,7 +646,7 @@ class TrainingState(): print(f'{"{:.3f}".format(percent*100)}% {message}') self.buffer.append(f'{"{:.3f}".format(percent*100)}% {message}') - self.cleanup_old() + self.cleanup_old(keep=keep_x_past_datasets) self.buffer = self.buffer[-buffer_size:] if verbose or not self.training_started: @@ -668,7 +668,7 @@ def run_training(config_path, verbose=False, buffer_size=8, keep_x_past_datasets for line in iter(training_state.process.stdout.readline, ""): - res = training_state.parse( line=line, verbose=verbose, buffer_size=buffer_size, progress=progress ) + res = training_state.parse( line=line, verbose=verbose, buffer_size=buffer_size, keep_x_past_datasets=keep_x_past_datasets, progress=progress ) print(f"[Training] [{datetime.now().isoformat()}] {line[:-1]}") if res: yield res