Skip to content

Commit

Permalink
Actually fix GS transducer test prediction decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
asumagic committed Oct 23, 2024
1 parent de7a7e8 commit 5b15078
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions recipes/GigaSpeech/ASR/transducer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,12 @@ def compute_objectives(self, predictions, batch, stage):
logits_transducer, tokens, wav_lens, token_lens
)

if stage == sb.Stage.VALID:
if stage != sb.Stage.TRAIN:
# Decode token terms to words
predicted_words = self.tokenizer(
predicted_tokens, task="decode_from_list"
)
elif stage == sb.Stage.TEST:
predicted_words = [
self.tokenizer.decode_ids(utt_seq).split(" ")
for utt_seq in predicted_tokens
]

if stage != sb.Stage.TRAIN:
# Convert indices to words
target_words = undo_padding(tokens, token_lens)
target_words = self.tokenizer(target_words, task="decode_from_list")
Expand Down

0 comments on commit 5b15078

Please sign in to comment.