MCPcopy
hub / github.com/Tele-AI/Telechat / PromptDataset

Class PromptDataset

deepspeed-telechat/utils/data/data_utils.py:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38class PromptDataset(Dataset):
39
40 def __init__(self, chosen_dataset) -> None:
41 super().__init__()
42 self.dataset = chosen_dataset
43
44 def __len__(self):
45 length = len(self.dataset)
46 return length
47
48 def __getitem__(self, idx):
49 return {
50 "input_ids": self.dataset[idx]["input_ids"],
51 "attention_mask": self.dataset[idx]["attention_mask"],
52 "labels": self.dataset[idx]["input_ids"]
53 }
54
55def get_weight_data(current_dataset, dataset_weight):
56 dataset = []

Callers 1

processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected