(self, max_steps, batch_size, max_length, world_size, valid_dataset_abbr, logging_steps=10)
| 13 | class CustomLoggingCallback(TrainerCallback): |
| 14 | |
| 15 | def __init__(self, max_steps, batch_size, max_length, world_size, valid_dataset_abbr, logging_steps=10): |
| 16 | self.cur_step, self.max_steps = 0, max_steps |
| 17 | self.start_time, self.valid_total_time = datetime.now(), 0 |
| 18 | self.batch_token = batch_size * max_length |
| 19 | self.world_size = world_size |
| 20 | self.valid_dataset_abbr = valid_dataset_abbr |
| 21 | self.logging_steps = logging_steps |
| 22 | |
| 23 | self.rank = torch.distributed.get_rank() |
| 24 | |
| 25 | def on_log(self, args: TrainingArguments, state: TrainerState, control: TrainerControl, logs=None, **kwargs): |
| 26 | now = datetime.now() |
nothing calls this directly
no outgoing calls
no test coverage detected