varora commited on
Commit
b4796b0
1 Parent(s): b7e329d

changes to hit.py

Browse files
Files changed (1) hide show
  1. hit.py +12 -0
hit.py CHANGED
@@ -118,11 +118,23 @@ class NewDataset(datasets.GeneratorBasedBuilder):
118
 
119
  gender = self.config.name
120
  #data_urls = _BASE_URL + rel_path
 
121
 
122
  file_structure_url = "hit_dataset.json"
123
  file_structure = dl_manager.download_and_extract(file_structure_url)
 
124
  with open(file_structure) as f:
125
  file_structure = json.load(f)
 
 
 
 
 
 
 
 
 
 
126
  if not gender is None:
127
  data_urls = {split: [os.path.join(gender, split, filename) for filename in file_structure[gender][split]] for split in splits}
128
  else:
 
118
 
119
  gender = self.config.name
120
  #data_urls = _BASE_URL + rel_path
121
+ print(gender)
122
 
123
  file_structure_url = "hit_dataset.json"
124
  file_structure = dl_manager.download_and_extract(file_structure_url)
125
+
126
  with open(file_structure) as f:
127
  file_structure = json.load(f)
128
+
129
+ cropped_train = file_structure[gender]['train'][:10]
130
+ file_structure[gender]['train'] = cropped_train
131
+
132
+ cropped_val = file_structure[gender]['val'][:10]
133
+ file_structure[gender]['val'] = cropped_val
134
+
135
+ cropped_test = file_structure[gender]['test'][:10]
136
+ file_structure[gender]['test'] = cropped_test
137
+
138
  if not gender is None:
139
  data_urls = {split: [os.path.join(gender, split, filename) for filename in file_structure[gender][split]] for split in splits}
140
  else: