From 5ddc79a866cc8662f0f890ab46b7d349f5007c69 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 12 May 2021 02:52:57 +0000 Subject: [PATCH] fix decoder using blank_id=0 --- .clang-format | 4 ++-- deepspeech/decoders/swig/ctc_beam_search_decoder.cpp | 6 ++++-- deepspeech/decoders/swig/setup.sh | 0 3 files changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 deepspeech/decoders/swig/setup.sh diff --git a/.clang-format b/.clang-format index 30863c27a..af946a4a9 100644 --- a/.clang-format +++ b/.clang-format @@ -16,8 +16,8 @@ --- Language: Cpp BasedOnStyle: Google -IndentWidth: 2 -TabWidth: 2 +IndentWidth: 4 +TabWidth: 4 ContinuationIndentWidth: 4 MaxEmptyLinesToKeep: 2 AccessModifierOffset: -2 # The private/protected/public has no indent in class diff --git a/deepspeech/decoders/swig/ctc_beam_search_decoder.cpp b/deepspeech/decoders/swig/ctc_beam_search_decoder.cpp index 68aec2090..f4dd797dc 100644 --- a/deepspeech/decoders/swig/ctc_beam_search_decoder.cpp +++ b/deepspeech/decoders/swig/ctc_beam_search_decoder.cpp @@ -40,13 +40,15 @@ std::vector> ctc_beam_search_decoder( size_t num_time_steps = probs_seq.size(); for (size_t i = 0; i < num_time_steps; ++i) { VALID_CHECK_EQ(probs_seq[i].size(), - vocabulary.size() + 1, + // vocabulary.size() + 1, + vocabulary.size(), "The shape of probs_seq does not match with " "the shape of the vocabulary"); } // assign blank id - size_t blank_id = vocabulary.size(); + //size_t blank_id = vocabulary.size(); + size_t blank_id = 0; // assign space id auto it = std::find(vocabulary.begin(), vocabulary.end(), " "); diff --git a/deepspeech/decoders/swig/setup.sh b/deepspeech/decoders/swig/setup.sh old mode 100644 new mode 100755