jimregan commited on
Commit
620b830
1 Parent(s): 0a5add8
Files changed (1) hide show
  1. nst_swedish_tts.py +5 -4
nst_swedish_tts.py CHANGED
@@ -60,10 +60,10 @@ IGNORE_SENT = [
60
  "det gläder oss självklart"
61
  ]
62
  IGNORE_ID = [
63
- "4912",
64
  ]
65
  # MAYBE_FIX = {
66
- # "4912": "en annan gång tar vi ett annat grepp"
67
  # }
68
 
69
  def read_with_soundfile(filename):
@@ -126,7 +126,7 @@ class NSTDataset(datasets.GeneratorBasedBuilder):
126
  for line in text.readlines():
127
  line = line.strip()
128
  if line in IGNORE_SENT:
129
- if str(counter) in IGNORE_ID:
130
  counter += 1
131
  continue
132
  else:
@@ -135,7 +135,8 @@ class NSTDataset(datasets.GeneratorBasedBuilder):
135
  counter += 1
136
  for file in filepath.glob("*.pcm"):
137
  stem = file.stem
138
- if is_pcm(str(file)):
 
139
  data, _ = read_with_soundfile(str(file))
140
  yield stem, {
141
  "audio": {
 
60
  "det gläder oss självklart"
61
  ]
62
  IGNORE_ID = [
63
+ "4913",
64
  ]
65
  # MAYBE_FIX = {
66
+ # "4913": "en annan gång tar vi ett annat grepp"
67
  # }
68
 
69
  def read_with_soundfile(filename):
 
126
  for line in text.readlines():
127
  line = line.strip()
128
  if line in IGNORE_SENT:
129
+ if f"{counter:04d}" in IGNORE_ID:
130
  counter += 1
131
  continue
132
  else:
 
135
  counter += 1
136
  for file in filepath.glob("*.pcm"):
137
  stem = file.stem
138
+ id = stem.split("_")[-1]
139
+ if is_pcm(str(file)) and not id in IGNORE_ID:
140
  data, _ = read_with_soundfile(str(file))
141
  yield stem, {
142
  "audio": {