cleanup logging

This commit is contained in:
Damian Stewart 2023-10-22 23:00:54 +02:00
parent 69158fa51b
commit 380b2a54ca
1 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,7 @@ class Accumulnator(BasePlugin):
def __init__(self):
path = os.path.join(os.path.dirname(__file__), "accumulnator.json")
logging.info(f" * Textual Inversion plugin instantiated, loading config from {path}")
logging.info(f" * Accumulnator plugin instantiated, loading config from {path}")
with open(path, 'rt') as f:
config = json.load(f)
begin_epoch = config['begin_epoch']
@ -39,6 +39,9 @@ class Accumulnator(BasePlugin):
for i in range(steps):
#print(f"took accum {accums[i]} for epoch {i+begin_epoch}")
accums_per_epoch[i+begin_epoch] = round(accums[i])
logging.info(f" * Accumulnator will set grad_accum as follows: {accums_per_epoch}")
self.per_epoch_grad_accum = accums_per_epoch
@ -47,9 +50,9 @@ class Accumulnator(BasePlugin):
epoch = just_finished_epoch + 1
grad_accum = self.per_epoch_grad_accum.get(epoch)
if grad_accum is None:
logging.warning(f" * Acculmunator has no grad_accum setting for epoch {epoch} - leaving as-is")
logging.warning(f" * Accumulnator has no grad_accum setting for epoch {epoch} - leaving as-is")
else:
logging.info(f" * Acculmunator setting grad_accum for epoch {epoch} to {grad_accum}")
logging.info(f" * Accumulnator setting grad_accum for epoch {epoch} to {grad_accum}")
arg_update_callback = kwargs['arg_update_callback']
arg_update_callback('grad_accum', grad_accum)