MCPcopy Create free account
hub / github.com/OpenMOSS/rope_pp / __init__

Method __init__

utils/callback_utils.py:15–23  ·  view source on GitHub ↗
(self, max_steps, batch_size, max_length, world_size, valid_dataset_abbr, logging_steps=10)

Source from the content-addressed store, hash-verified

13class 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()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected