MCPcopy Create free account
hub / github.com/canopyai/Orpheus-TTS / AlternatingDistributedSampler

Class AlternatingDistributedSampler

pretrain/train.py:76–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76class AlternatingDistributedSampler(DistributedSampler):
77 def __init__(self, dataset, num_replicas=None, rank=None, shuffle=False):
78 super().__init__(dataset, num_replicas=num_replicas, rank=rank, shuffle=shuffle)
79 self.shuffle = shuffle
80
81 def __iter__(self):
82 indices = list(range(len(self.dataset)))
83 indices = indices[self.rank:self.total_size:self.num_replicas]
84 return iter(indices)
85
86
87class FSDPTrainer(Trainer):

Callers 1

get_train_dataloaderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected