MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / create_dataset_function

Function create_dataset_function

SwissArmyTransformer/tests/test_train.py:105–115  ·  view source on GitHub ↗
(path, args)

Source from the content-addressed store, hash-verified

103 return self.process_fn(super().__getitem__(idx))
104
105def create_dataset_function(path, args):
106 num_samples = 100000
107 num_features = 5
108
109 x = torch.randint(0, 100, (num_samples, num_features))
110
111 def process_fn(row):
112 return {'text': row[0],
113 'loss_mask': np.array([1]*len(row[0]))
114 }
115 return FakeDataset(process_fn, x)
116
117if __name__ == '__main__':
118 import os

Callers 1

make_dataset_fullFunction · 0.50

Calls 1

FakeDatasetClass · 0.70

Tested by

no test coverage detected