Porjaz commited on
Commit
79892f2
·
verified ·
1 Parent(s): 6b2c1d4

Update custom_interface.py

Browse files
Files changed (1) hide show
  1. custom_interface.py +6 -1
custom_interface.py CHANGED
@@ -20,7 +20,12 @@ class ASR(Pretrained):
20
 
21
  # Output layer for seq2seq log-probabilities
22
  predictions = self.hparams.test_search(encoded_outputs, self.wav_lens)[0]
23
- predicted_words = [self.hparams.tokenizer.decode_ids(prediction).split(" ") for prediction in predictions if 0 not in prediction]
 
 
 
 
 
24
  prediction = []
25
  for sent in predicted_words:
26
  sent = self.filter_repetitions(sent, 3)
 
20
 
21
  # Output layer for seq2seq log-probabilities
22
  predictions = self.hparams.test_search(encoded_outputs, self.wav_lens)[0]
23
+ # predicted_words = [self.hparams.tokenizer.decode_ids(prediction).split(" ") for prediction in predictions]
24
+ predicted_words = []
25
+ for prediction in predictions:
26
+ print(prediction)
27
+ if prediction != 0:
28
+ predicted_words.append(self.hparams.tokenizer.decode_ids(prediction).split(" "))
29
  prediction = []
30
  for sent in predicted_words:
31
  sent = self.filter_repetitions(sent, 3)