MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

distributed/FSDP/summarization_dataset.py:27–34  ·  view source on GitHub ↗
(self, tokenizer, type_path, num_samples, input_length, output_length, print_text=False)

Source from the content-addressed store, hash-verified

25
26class wikihow(Dataset):
27 def __init__(self, tokenizer, type_path, num_samples, input_length, output_length, print_text=False):
28 self.dataset = load_dataset('wikihow', 'all', data_dir='data/', split=type_path)
29 if num_samples:
30 self.dataset = self.dataset.select(list(range(0, num_samples)))
31 self.input_length = input_length
32 self.tokenizer = tokenizer
33 self.output_length = output_length
34 self.print_text = print_text
35
36 def __len__(self):
37 return self.dataset.shape[0]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected