From d4ffa16112a062e0b2fc5f8f9d6c860223f3b7ab Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Sun, 24 Apr 2022 09:30:12 +0000 Subject: [PATCH] format --- paddlespeech/__init__.py | 2 -- .../ds2_ol/decoder/ctc-prefix-beam-search-decoder-ol.cc | 4 +++- speechx/examples/ds2_ol/decoder/wfst-decoder-ol.cc | 4 +++- .../examples/ds2_ol/feat/linear-spectrogram-wo-db-norm-ol.cc | 2 +- speechx/speechx/decoder/param.h | 4 +++- speechx/speechx/frontend/audio/audio_cache.h | 2 +- speechx/speechx/frontend/audio/mfcc.cc | 2 +- speechx/speechx/nnet/paddle_nnet.cc | 2 +- speechx/speechx/nnet/paddle_nnet.h | 2 +- 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/paddlespeech/__init__.py b/paddlespeech/__init__.py index 4b1c0ef3..b781c4a8 100644 --- a/paddlespeech/__init__.py +++ b/paddlespeech/__init__.py @@ -14,5 +14,3 @@ import _locale _locale._getdefaultlocale = (lambda *args: ['en_US', 'utf8']) - - diff --git a/speechx/examples/ds2_ol/decoder/ctc-prefix-beam-search-decoder-ol.cc b/speechx/examples/ds2_ol/decoder/ctc-prefix-beam-search-decoder-ol.cc index a04b1c86..46a78ef9 100644 --- a/speechx/examples/ds2_ol/decoder/ctc-prefix-beam-search-decoder-ol.cc +++ b/speechx/examples/ds2_ol/decoder/ctc-prefix-beam-search-decoder-ol.cc @@ -41,7 +41,9 @@ DEFINE_string( DEFINE_string(model_output_names, "softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0", "model output names"); -DEFINE_string(model_cache_names, "chunk_state_h_box,chunk_state_c_box", "model cache names"); +DEFINE_string(model_cache_names, + "chunk_state_h_box,chunk_state_c_box", + "model cache names"); DEFINE_string(model_cache_shapes, "5-1-1024,5-1-1024", "model cache shapes"); using kaldi::BaseFloat; diff --git a/speechx/examples/ds2_ol/decoder/wfst-decoder-ol.cc b/speechx/examples/ds2_ol/decoder/wfst-decoder-ol.cc index bbb27b39..cb68a5a2 100644 --- a/speechx/examples/ds2_ol/decoder/wfst-decoder-ol.cc +++ b/speechx/examples/ds2_ol/decoder/wfst-decoder-ol.cc @@ -44,7 +44,9 @@ DEFINE_string( DEFINE_string(model_output_names, "softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0", "model output names"); -DEFINE_string(model_cache_names, "chunk_state_h_box,chunk_state_c_box", "model cache names"); +DEFINE_string(model_cache_names, + "chunk_state_h_box,chunk_state_c_box", + "model cache names"); DEFINE_string(model_cache_shapes, "5-1-1024,5-1-1024", "model cache shapes"); using kaldi::BaseFloat; diff --git a/speechx/examples/ds2_ol/feat/linear-spectrogram-wo-db-norm-ol.cc b/speechx/examples/ds2_ol/feat/linear-spectrogram-wo-db-norm-ol.cc index 0b066d6a..c3652ad4 100644 --- a/speechx/examples/ds2_ol/feat/linear-spectrogram-wo-db-norm-ol.cc +++ b/speechx/examples/ds2_ol/feat/linear-spectrogram-wo-db-norm-ol.cc @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) { int32 num_done = 0, num_err = 0; - // feature pipeline: wave cache --> hanning window + // feature pipeline: wave cache --> hanning window // -->linear_spectrogram --> global cmvn -> feat cache std::unique_ptr data_source( diff --git a/speechx/speechx/decoder/param.h b/speechx/speechx/decoder/param.h index cd68e5e9..ef565621 100644 --- a/speechx/speechx/decoder/param.h +++ b/speechx/speechx/decoder/param.h @@ -43,7 +43,9 @@ DEFINE_string( DEFINE_string(model_output_names, "softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0", "model output names"); -DEFINE_string(model_cache_names, "chunk_state_h_box,chunk_state_c_box", "model cache names"); +DEFINE_string(model_cache_names, + "chunk_state_h_box,chunk_state_c_box", + "model cache names"); DEFINE_string(model_cache_shapes, "5-1-1024,5-1-1024", "model cache shapes"); diff --git a/speechx/speechx/frontend/audio/audio_cache.h b/speechx/speechx/frontend/audio/audio_cache.h index c44deddd..4ebcd947 100644 --- a/speechx/speechx/frontend/audio/audio_cache.h +++ b/speechx/speechx/frontend/audio/audio_cache.h @@ -58,7 +58,7 @@ class AudioCache : public FrontendInterface { std::mutex mutex_; std::condition_variable ready_feed_condition_; kaldi::int32 timeout_; // millisecond - bool to_float32_; // int16 -> float32. used in linear_spectrogram + bool to_float32_; // int16 -> float32. used in linear_spectrogram DISALLOW_COPY_AND_ASSIGN(AudioCache); }; diff --git a/speechx/speechx/frontend/audio/mfcc.cc b/speechx/speechx/frontend/audio/mfcc.cc index 115d3367..bda1f96d 100644 --- a/speechx/speechx/frontend/audio/mfcc.cc +++ b/speechx/speechx/frontend/audio/mfcc.cc @@ -30,7 +30,7 @@ using kaldi::Matrix; using std::vector; Mfcc::Mfcc(const MfccOptions& opts, - std::unique_ptr base_extractor) + std::unique_ptr base_extractor) : opts_(opts), computer_(opts.mfcc_opts), window_function_(computer_.GetFrameOptions()) { diff --git a/speechx/speechx/nnet/paddle_nnet.cc b/speechx/speechx/nnet/paddle_nnet.cc index 6cf6aa5e..881a82f5 100644 --- a/speechx/speechx/nnet/paddle_nnet.cc +++ b/speechx/speechx/nnet/paddle_nnet.cc @@ -206,7 +206,7 @@ void PaddleNnet::FeedForward(const Vector& features, inferences->Resize(row * col); *inference_dim = col; output_tensor->CopyToCpu(inferences->Data()); - + ReleasePredictor(predictor); } diff --git a/speechx/speechx/nnet/paddle_nnet.h b/speechx/speechx/nnet/paddle_nnet.h index fdd51048..e2b3d5bc 100644 --- a/speechx/speechx/nnet/paddle_nnet.h +++ b/speechx/speechx/nnet/paddle_nnet.h @@ -24,7 +24,7 @@ namespace ppspeech { struct ModelOptions { std::string model_path; std::string param_path; - int thread_num; // predictor thread pool size + int thread_num; // predictor thread pool size bool use_gpu; bool switch_ir_optim; std::string input_names;