How we can perform greedy decoding for RNN_T ?
Hi,
I trained an RNNT model using vivos recipe. I performed the decoding using beam search successfully now I'm trying to perform the decoding with greedy search I thought I could do that by setting beam-size parameter to 1:

**# decoding parameters**
batch: 0
**beam-size: 1**
search-type: default
score-norm: True

 but I got this error:

  File "/home/selma/espnet/espnet/asr/pytorch_backend/asr.py", line 1074, in recog
    js[name], nbest_hyps, train_args.char_list
  File "/home/selma/espnet/espnet/asr/asr_utils.py", line 828, in add_results_to_json
    rec_text, rec_token, rec_tokenid, score = parse_hypothesis(hyp, char_list)
  File "/home/selma/espnet/espnet/asr/asr_utils.py", line 796, in parse_hypothesis
    tokenid_as_list = list(map(int, hyp["yseq"][1:]))
TypeError: string indices must be integers

So I would like to know how could I perform greedy decoding for my model.
Thanks in advance!

diff --git a/espnet/nets/beam_search_transducer.py b/espnet/nets/beam_search_transducer.py
index 9703d0299..697a9d035 100644
--- a/espnet/nets/beam_search_transducer.py
+++ b/espnet/nets/beam_search_transducer.py
@@ -158,7 +158,7 @@ class BeamSearchTransducer:
 
                 y, state, _ = self.decoder.score(hyp, cache, init_tensor)
 
-        return hyp
+        return [hyp]
 
     def default_beam_search(self, h: torch.Tensor) -> List[Hypothesis]:
         """Beam search implementation.
diff --git a/espnet/nets/e2e_asr_common.py b/espnet/nets/e2e_asr_common.py
index 9c462e568..32f61ad9a 100644
--- a/espnet/nets/e2e_asr_common.py
+++ b/espnet/nets/e2e_asr_common.py
@@ -309,7 +309,7 @@ class ErrorCalculatorTransducer(object):
 
         for b in six.moves.range(batchsize):
             nbest_hyps = self.beam_search(hs_pad[b])
-            batch_nbest.append(nbest_hyps)
+            batch_nbest.append(nbest_hyps[-1])
 
         ys_hat = [nbest_hyp.yseq[1:] for nbest_hyp in batch_nbest]
 
diff --git a/test/test_e2e_asr_sa_transducer.py b/test/test_e2e_asr_sa_transducer.py
index 98120b506..8810a0f7b 100644
--- a/test/test_e2e_asr_sa_transducer.py
+++ b/test/test_e2e_asr_sa_transducer.py
@@ -280,10 +280,7 @@ def test_sa_transducer_trainable_and_decodable(train_dic, recog_dic):
         nbest = model.recognize(x[0, : ilens[0]].numpy(), beam_search)
 
         print(y[0])
-        if recog_args.beam_size == 1:
-            print(nbest["yseq"][1:-1])
-        else:
-            print(nbest[0]["yseq"][1:-1])
+        print(nbest[0]["yseq"][1:-1])
 
 
 def test_calculate_plot_attention():
['espnet/nets/e2e_asr_common.py', 'test/test_e2e_asr_sa_transducer.py', 'espnet/nets/beam_search_transducer.py']