Skip to content

Commit

Permalink
make sure any empty segments are removed (#7155)
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Rastorgueva <erastorgueva@nvidia.com>
Signed-off-by: jubick1337 <mattyson.so@gmail.com>
  • Loading branch information
erastorgueva-nv authored and jubick1337 committed Aug 8, 2023
1 parent a880d3a commit 2937b1f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/nemo_forced_aligner/utils/data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def get_utt_obj(

# remove any spaces at start and end of segments
segments = [seg.strip() for seg in segments]
# remove any empty segments
segments = [seg for seg in segments if len(seg) > 0]

utt = Utterance(text=text, audio_filepath=audio_filepath, utt_id=utt_id,)

Expand Down

0 comments on commit 2937b1f

Please sign in to comment.