MCPcopy Create free account
hub / github.com/OpenSparseLLMs/Linear-MoE / build_dataset

Function build_dataset

linear_moe/data/__init__.py:206–222  ·  view source on GitHub ↗
(index, name)

Source from the content-addressed store, hash-verified

204 # Print stats about the splits.
205
206 def build_dataset(index, name):
207 dataset = None
208 if splits[index + 1] > splits[index]:
209 documents = np.arange(start=splits[index],
210 stop=splits[index + 1],
211 step=1,
212 dtype=np.int32)
213 if dataset_type == 'LLama-Pretrain-Idxmap':
214 from .llama import LLamaIdxMapDataset
215 dataset = LLamaIdxMapDataset(
216 name, data_prefix, documents, indexed_dataset,
217 train_valid_test_num_samples[index],
218 seed, max_padding_length, return_doc_ids)
219 else:
220 raise RuntimeError("The provided dataset_type is not supported in Pretrain mode. \nChoose from [LLama-Pretrain-Idxmap].")
221
222 return dataset
223
224 train_dataset = build_dataset(0, 'train')
225 valid_dataset = build_dataset(1, 'valid')

Callers 1

Calls 1

LLamaIdxMapDatasetClass · 0.85

Tested by

no test coverage detected