birgermoell commited on
Commit
368c070
1 Parent(s): 939d303

Updated loading script

Browse files
Files changed (1) hide show
  1. speechdat.py +17 -7
speechdat.py CHANGED
@@ -98,12 +98,22 @@ class SpeechDat(datasets.GeneratorBasedBuilder):
98
  text_line = get_single_line(text_file)
99
  if text_line is None or text_line == "":
100
  continue
101
- with open(wav_file, "rb") as wav_data:
102
- yield str(wav_file), {
103
- "path": str(wav_file),
104
- "sentence": text_line,
105
- "audio": {
106
  "path": str(wav_file),
107
- "bytes": wav_data.read()
 
 
 
 
108
  }
109
- }
 
 
 
 
 
 
 
 
98
  text_line = get_single_line(text_file)
99
  if text_line is None or text_line == "":
100
  continue
101
+ size = os.path.getsize(wav_file)
102
+ if size > 1024:
103
+ with open(wav_file, "rb") as wav_data:
104
+ yield str(wav_file), {
 
105
  "path": str(wav_file),
106
+ "sentence": text_line,
107
+ "audio": {
108
+ "path": str(wav_file),
109
+ "bytes": wav_data.read()
110
+ }
111
  }
112
+
113
+
114
+
115
+ def normalize(text):
116
+ # remove ~
117
+
118
+
119
+ return text