From 1f23c4bd24e70c2e3939f4e631c886459bd3d135 Mon Sep 17 00:00:00 2001 From: Yang Zhou Date: Mon, 11 Apr 2022 21:20:14 +0800 Subject: [PATCH] remove unnecessary log --- .../decoder/offline_decoder_sliding_chunk_main.cc | 10 ++++++---- .../examples/decoder/offline_wfst_decoder_main.cc | 12 +++++++----- speechx/speechx/nnet/decodable.cc | 1 - speechx/speechx/nnet/paddle_nnet.cc | 1 - 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/speechx/examples/decoder/offline_decoder_sliding_chunk_main.cc b/speechx/examples/decoder/offline_decoder_sliding_chunk_main.cc index 1bb9ce22..40092de3 100644 --- a/speechx/examples/decoder/offline_decoder_sliding_chunk_main.cc +++ b/speechx/examples/decoder/offline_decoder_sliding_chunk_main.cc @@ -136,14 +136,16 @@ int main(int argc, char* argv[]) { } std::string result; result = decoder.GetFinalBestPath(); - KALDI_LOG << " the result of " << utt << " is " << result; + decodable->Reset(); + decoder.Reset(); if (result.empty()) { // the TokenWriter can not write empty string. - result = " "; + ++num_err; + KALDI_LOG << " the result of " << utt << " is empty"; + continue; } + KALDI_LOG << " the result of " << utt << " is " << result; result_writer.Write(utt, result); - decodable->Reset(); - decoder.Reset(); ++num_done; } diff --git a/speechx/examples/decoder/offline_wfst_decoder_main.cc b/speechx/examples/decoder/offline_wfst_decoder_main.cc index 2520922a..06460a45 100644 --- a/speechx/examples/decoder/offline_wfst_decoder_main.cc +++ b/speechx/examples/decoder/offline_wfst_decoder_main.cc @@ -139,14 +139,16 @@ int main(int argc, char* argv[]) { } std::string result; result = decoder.GetFinalBestPath(); - KALDI_LOG << " the result of " << utt << " is " << result; - if (result.empty()) { + decodable->Reset(); + decoder.Reset(); + if (result.empty()) { // the TokenWriter can not write empty string. - result = " "; + ++num_err; + KALDI_LOG << " the result of " << utt << " is empty"; + continue; } + KALDI_LOG << " the result of " << utt << " is " << result; result_writer.Write(utt, result); - decodable->Reset(); - decoder.Reset(); ++num_done; } diff --git a/speechx/speechx/nnet/decodable.cc b/speechx/speechx/nnet/decodable.cc index 1bf870d8..ce269650 100644 --- a/speechx/speechx/nnet/decodable.cc +++ b/speechx/speechx/nnet/decodable.cc @@ -78,7 +78,6 @@ bool Decodable::AdvanceChunk() { frame_offset_ = frames_ready_; frames_ready_ += nnet_cache_.NumRows(); - LOG(INFO) << "nnet size: " << nnet_cache_.NumRows(); return true; } diff --git a/speechx/speechx/nnet/paddle_nnet.cc b/speechx/speechx/nnet/paddle_nnet.cc index c065d530..5c4da11a 100644 --- a/speechx/speechx/nnet/paddle_nnet.cc +++ b/speechx/speechx/nnet/paddle_nnet.cc @@ -177,7 +177,6 @@ void PaddleNnet::FeedForward(const Vector& features, LOG(INFO) << "predictor run occurs error"; } - LOG(INFO) << "get the model success"; std::unique_ptr h_out = predictor->GetOutputHandle(output_names[2]); assert(h_cache->get_shape() == h_out->shape());