Skip to content

Commit

Permalink
remove outdated code in train.py (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored May 24, 2023
1 parent af8907e commit 1aeffa7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
8 changes: 0 additions & 8 deletions egs/librispeech/ASR/transducer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,6 @@ def remove_short_and_long_utt(c: Cut):

train_cuts = train_cuts.filter(remove_short_and_long_utt)

num_left = len(train_cuts)
num_removed = num_in_total - num_left
removed_percent = num_removed / num_in_total * 100

logging.info(f"Before removing short and long utterances: {num_in_total}")
logging.info(f"After removing short and long utterances: {num_left}")
logging.info(f"Removed {num_removed} utterances ({removed_percent:.5f}%)")

train_dl = librispeech.train_dataloaders(train_cuts)

valid_cuts = librispeech.dev_clean_cuts()
Expand Down
14 changes: 0 additions & 14 deletions egs/librispeech/ASR/transducer_stateless/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,20 +654,6 @@ def remove_short_and_long_utt(c: Cut):

train_cuts = train_cuts.filter(remove_short_and_long_utt)

try:
num_left = len(train_cuts)
num_removed = num_in_total - num_left
removed_percent = num_removed / num_in_total * 100

logging.info(f"Before removing short and long utterances: {num_in_total}")
logging.info(f"After removing short and long utterances: {num_left}")
logging.info(f"Removed {num_removed} utterances ({removed_percent:.5f}%)")
except TypeError as e:
# You can ignore this error as previous versions of Lhotse work fine
# for the above code. In recent versions of Lhotse, it uses
# lazy filter, producing cutsets that don't have the __len__ method
logging.info(str(e))

train_dl = librispeech.train_dataloaders(train_cuts)

valid_cuts = librispeech.dev_clean_cuts()
Expand Down
14 changes: 0 additions & 14 deletions egs/librispeech/ASR/transducer_stateless2/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,20 +642,6 @@ def remove_short_and_long_utt(c: Cut):

train_cuts = train_cuts.filter(remove_short_and_long_utt)

try:
num_left = len(train_cuts)
num_removed = num_in_total - num_left
removed_percent = num_removed / num_in_total * 100

logging.info(f"Before removing short and long utterances: {num_in_total}")
logging.info(f"After removing short and long utterances: {num_left}")
logging.info(f"Removed {num_removed} utterances ({removed_percent:.5f}%)")
except TypeError as e:
# You can ignore this error as previous versions of Lhotse work fine
# for the above code. In recent versions of Lhotse, it uses
# lazy filter, producing cutsets that don't have the __len__ method
logging.info(str(e))

train_dl = librispeech.train_dataloaders(train_cuts)

valid_cuts = librispeech.dev_clean_cuts()
Expand Down

0 comments on commit 1aeffa7

Please sign in to comment.