MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __init__

Method __init__

DeepSpeedExample/tasks/glue/data.py:31–49  ·  view source on GitHub ↗
(self, task_name, dataset_name, datapaths,
                 tokenizer, max_seq_length)

Source from the content-addressed store, hash-verified

29 """GLUE base dataset class."""
30
31 def __init__(self, task_name, dataset_name, datapaths,
32 tokenizer, max_seq_length):
33 # Store inputs.
34 self.task_name = task_name
35 self.dataset_name = dataset_name
36 self.tokenizer = tokenizer
37 self.max_seq_length = max_seq_length
38 print_rank_0(' > building {} dataset for {}:'.format(self.task_name,
39 self.dataset_name))
40 # Process the files.
41 string = ' > paths:'
42 for path in datapaths:
43 string += ' ' + path
44 print_rank_0(string)
45 self.samples = []
46 for datapath in datapaths:
47 self.samples.extend(self.process_samples_from_single_path(datapath))
48 print_rank_0(' >> total number of samples: {}'.format(
49 len(self.samples)))
50
51 def __len__(self):
52 return len(self.samples)

Callers

nothing calls this directly

Calls 3

print_rank_0Function · 0.90
extendMethod · 0.80

Tested by

no test coverage detected