Skip to content

Commit

Permalink
Minor fix to egs2/aishell4/enh1/local/prepare_audioset_category_list.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Emrys365 committed Apr 15, 2022
1 parent 4778629 commit 72afca7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion egs2/aishell4/enh1/local/prepare_audioset_category_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def prepare_audioset_category(audio_list, audioset_dir, output_file, skip_csv_ro
ytid = re.sub(r"(.*)_\d+\.\d+", r"\1", Path(audio).stem)
ret.append("%s %s\n" % (ytid, utt2category[ytid]))

with Path(output_file).open("w") as f:
outfile = Path(output_file)
outfile.parent.mkdir(parents=True, exist_ok=True)
with outfile.open("w") as f:
for line in ret:
f.write(line)

Expand Down

0 comments on commit 72afca7

Please sign in to comment.