MCPcopy Create free account
hub / github.com/THUDM/LongWriter / __init__

Method __init__

train/dataset.py:48–50  ·  view source on GitHub ↗
(self, filepath)

Source from the content-addressed store, hash-verified

46
47class LMPackDataset(torch.utils.data.Dataset):
48 def __init__(self, filepath):
49 self.input_ids, self.attention_masks, self.labels, self.weights, self.nums = self.process_data(filepath)
50 self.num_gpus = torch.cuda.device_count()
51
52 def process_data(self, filepath):
53 input_ids = torch.from_numpy(np.load(os.path.join(filepath, 'inputs_pack.npy')))

Callers

nothing calls this directly

Calls 1

process_dataMethod · 0.95

Tested by

no test coverage detected