MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / build_dataset

Function build_dataset

codegeex/megatron/data/prompt_dataset.py:135–152  ·  view source on GitHub ↗
(index, name)

Source from the content-addressed store, hash-verified

133 print_split_stats("test", 2)
134
135 def build_dataset(index, name):
136 dataset = None
137 if splits[index + 1] > splits[index]:
138 documents = np.arange(
139 start=splits[index], stop=splits[index + 1], step=1, dtype=np.int32
140 )
141 dataset = PromptDataset(
142 name,
143 data_prefix,
144 documents,
145 input_ids_indexed_dataset,
146 attention_mask_indexed_dataset,
147 labels_indexed_dataset,
148 train_valid_test_num_samples[index],
149 seq_length,
150 seed,
151 )
152 return dataset
153
154 train_dataset = build_dataset(0, "train")
155 valid_dataset = build_dataset(1, "valid")

Callers 1

Calls 1

PromptDatasetClass · 0.85

Tested by

no test coverage detected