jayliqinzhang commited on
Commit
06d9173
·
verified ·
1 Parent(s): 7f02aff

Upload mumospee_small.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. mumospee_small.py +18 -19
mumospee_small.py CHANGED
@@ -129,15 +129,13 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
129
  ]
130
 
131
 
132
-
133
  def _generate_examples(self, filepath):
134
 
135
  data = pd.read_csv(filepath)
136
- split=self.config.split
137
 
138
-
139
- language=self.config.language
140
- tag=self.config.tag
141
 
142
  print(f'Return {split} dataset in langauge of {language}, originally from {tag}.')
143
 
@@ -157,20 +155,21 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
157
  print(f"No data found for split='{split}', language='{language}', tag='{tag}'. Returning None.")
158
  return # This exits the generator without yielding any examples
159
 
160
-
161
- for i, row in data_split.iterrows():
162
- yield i, {
163
- "path": row["path"],
164
- #"local_path": row["local_path"],
165
- "url": row["url"],
166
- "type": row["type"],
167
- "duration": float(row["duration"]),
168
- "language": row["language"],
169
- "transcript": row["transcript"],
170
- "tag": row["tag"],
171
- "split": row["split"],
172
- "license": row["license"]
173
- }
 
174
 
175
 
176
 
 
129
  ]
130
 
131
 
 
132
  def _generate_examples(self, filepath):
133
 
134
  data = pd.read_csv(filepath)
135
+ split = self.config.split
136
 
137
+ language = self.config.language
138
+ tag = self.config.tag
 
139
 
140
  print(f'Return {split} dataset in langauge of {language}, originally from {tag}.')
141
 
 
155
  print(f"No data found for split='{split}', language='{language}', tag='{tag}'. Returning None.")
156
  return # This exits the generator without yielding any examples
157
 
158
+ else:
159
+
160
+ for i, row in data_split.iterrows():
161
+ yield i, {
162
+ "path": row["path"],
163
+ #"local_path": row["local_path"],
164
+ "url": row["url"],
165
+ "type": row["type"],
166
+ "duration": float(row["duration"]),
167
+ "language": row["language"],
168
+ "transcript": row["transcript"],
169
+ "tag": row["tag"],
170
+ "split": row["split"],
171
+ "license": row["license"]
172
+ }
173
 
174
 
175