MCPcopy
hub / github.com/InternLM/InternLM / init_batch_sampler

Method init_batch_sampler

internlm/core/trainer.py:46–50  ·  view source on GitHub ↗
(self, train_dl)

Source from the content-addressed store, hash-verified

44 self.tensorboard_folder = config.tensorboard_folder
45
46 def init_batch_sampler(self, train_dl):
47 # Copy of the batch sampler from the DataLoader
48 self.batch_sampler = train_dl.batch_sampler.copy()
49 # Iterator for the batch sampler
50 self.batch_sampler_iter = iter(self.batch_sampler)
51
52 def __str__(self) -> str:
53 """Returns a string representation of the training state in JSON format."""

Callers 1

mainFunction · 0.95

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected